ssts-hospital-web-master项目实战记录二十五:项目迁移-核心模块实现(useSystemService)
记录时间:2024-02-29
一、useSystemService模块实现
service/system/useTerminalService.ts
import * as config from '@/config'
import { Terminal, Receipt } from '@/types'
import { hydate, serveWebApi, GetAppSetting, LogInfo } from '@/common'
import { useSystemStore } from '@/store'
import { useSystemUtil } from '@/utils/system'
import { changeSuppliesUsageCurrentCount } from './useManageService'
const systemUtil = useSystemUtil()
// 获取终端服务状态
const getServiceStatus = async function (terminalIp: string) {
let msg = ''
const terminals = await serveWebApi('/api/Terminal/GetTerminalByTerminalIp', {
terminalIp
})
if (terminals && terminals.length > 0) {
const terminal = terminals[0] as Terminal
const systemStore = useSystemStore()
// 同步系统存储中的分组状态和终端状态
systemStore.syncDictTerminal(
'TerminalGroupStatus',
terminal.TerminalGroupStatus
)
systemStore.syncDictTerminal('Status', terminal.Status)
// 检查状态并设置相应的消息
if (systemStore.dictTerminal.TerminalGroupStatus === '0') {
msg = '终端所在分组当前状态不可用!'
} else if (systemStore.dictTerminal.Status === '0') {
msg = '终端当前状态不可用!'
}
}
return msg
}
// 获取终端服务时间
const getServiceTime = async function (
terminalGroupId: string,
terminalNo: string
) {
let msg = ''
const defaultTimeSpan = systemUtil.getServiceTimeSpan(
await GetAppSetting('AMStartTime'),
await GetAppSetting('AMEndTime'),
await GetAppSetting('PMStartTime'),
await GetAppSetting('PMEndTime'),
await GetAppSetting('NightStartTime'),
await GetAppSetting('NightEndTime')
)
const serviceTimeConfig =
(await serveWebApi('/api/Terminal/GetTerminalServiceTimeConfig', {
terminalGroupId,
terminalNo
})) || []
const terminalConfig = serviceTimeConfig.find(
(config: any) => config.ServiceType === 1
)
const terminalGroupConfig = serviceTimeConfig.find(
(config: any) => config.ServiceType === 0
)
if (terminalConfig) {
msg = systemUtil.getServiceTimeConfig(terminalConfig)
} else if (terminalGroupConfig) {
msg = systemUtil.getServiceTimeConfig(terminalGroupConfig)
} else {
msg = defaultTimeSpan
}
return msg
}
// 获取设备状态描述
const getDeviceStatusDescription = async function (
deviceName: string,
statusId: string
) {
const ret = await serveWebApi('/api/System/GetDeviceStatusDescription', {
deviceName: deviceName,
statusId: statusId
})
return ret
}
// 获取菜单
const getMenus = (terminalGroupId: string, parentMenuId: string) => {
const ret = serveWebApi('/api/System/GetMenus', {
terminalGroupId: terminalGroupId,
parentMenuId: parentMenuId
})
return ret
}
// 根据参数和配置组织文本打印
const receiptPrintRawData = (
terminalIp: string,
terminalNo: string,
businessTrace: string,
receiptPageName: string,
customCardNo: string,
customName: string,
formName: string,
values: string,
index: string
) => {
const receipt: any = serveWebApi('/api/System/GetReceiptRawData', {
printType: 'txt',
terminalIp: terminalIp,
terminalNo: terminalNo,
businessTrace: businessTrace,
receiptPageName: receiptPageName,
customCardNo: customCardNo,
customName: customName,
formName: formName,
values: values,
index: index
})
if (receipt) {
const now = new Date()
const folder = `${config.LogReceiptPrintDir}${hydate(now).format('YYYY-MM')}\\${hydate(now).format('YYYY-MM-DD')}\\`
const fileName = folder + receipt.fileName
const rawdata = receipt.formContent
LogInfo(folder, fileName, rawdata)
for (let i = 0; i < receipt.count; i++) {
// const ret = dd.receiptPrinter.printRawData(rawdata)
// if (ret == true) {
// dd.receiptPrinter.eject()
// }
}
const systemStore = useSystemStore()
changeSuppliesUsageCurrentCount(
'凭条纸',
systemStore.dictTerminal.TerminalNo,
1
)
}
}
// 根据参数组织网页打印
const receiptPrintRawDataHtml = (
terminalIp: string,
terminalNo: string,
businessTrace: string,
receiptPageName: string,
customCardNo: string,
customName: string,
formName: string,
values: string,
index: string
) => {
const receipt: any = serveWebApi('/api/System/GetReceiptRawData', {
printType: 'txt', //'html',
terminalIp: terminalIp,
terminalNo: terminalNo,
businessTrace: businessTrace,
receiptPageName: receiptPageName,
customCardNo: customCardNo,
customName: customName,
formName: formName,
values: values,
index: index
})
//debugger
if (receipt != null) {
const now = new Date()
const folder = `${config.LogReceiptPrintDir}${hydate(now).format('YYYY-MM')}\\${hydate(now).format('YYYY-MM-DD')}\\`
const fileName = folder + receipt.fileName
const serverFileFullPath = receipt.serverFileFullPath
const localFileName = hydate(now).format('YYYYMMDDHHmmss') + '.html'
const rawdata = `${window.location.protocol + '//' + window.location.host}/${GetAppSetting('ConfigDir')}/HtmlReceiptForm/${'CommonForm'}.html?fileName=${serverFileFullPath}&localFileName=${localFileName}`
LogInfo(folder, fileName, values)
for (let i = 0; i < receipt.count; i++) {
// var ret = dd.receiptPrinter.printRawData(rawdata);
const newContent = `<iframe src="${rawdata}" frameborder="0" scrolling="no" style="width: 0px; height: 0px; "></iframe>`
;(document.querySelector('#printpages') as HTMLDivElement).innerHTML +=
newContent
// const LocalPrintFileName = config.LogTempDir + localFileName
setTimeout(function () {
/*
var rawData = {
};
rawData['Timeout'] = 0;
rawData['PrintType'] = 0;
rawData['TotalPaperNum'] = 0;
rawData['SlotType'] = 0;
rawData['ChapterType'] = 0;
rawData['ChapterPosA'] = 0;
rawData['ChapterPosB'] = 0;
rawData['ChapterPosC'] = 0;
rawData['ChapterNum'] = 0;
rawData['FilePath'] = LocalPrintFileName;
*/
// const rawData = '0|0|0|0|0|0|0|0|' + LocalPrintFileName
// const ret = dd.receiptPrinter.printRawData(rawData)
const ret = true
if (ret == true) {
//dd.receiptPrinter.eject();
}
}, 1500)
}
const systemStore = useSystemStore()
changeSuppliesUsageCurrentCount(
'凭条纸',
systemStore.dictTerminal.TerminalNo,
1
)
}
}
// 添加凭条数据
const addReceiptData = (formName: string, jsonPrint: object) => {
const jsonPrintStr = JSON.stringify(jsonPrint)
const receipt = {} as Receipt
receipt.formName = formName
receipt.jsonPrintStr = jsonPrintStr
receipt.pageName = window.location.href
const systemStore = useSystemStore()
systemStore.addToDictReceiptList(receipt)
const now = new Date()
const folder = `D:\\LogInfo\\LogReceiptData\\${hydate(now).format('YYYY-MM')}\\`
const fileName = `${folder}LogReceipt${hydate(now).format('YYYY-MM-DD')}.txt`
LogInfo(folder, fileName, eval("'" + jsonPrintStr + "'") + ',')
}
export {
getServiceStatus,
getServiceTime,
getDeviceStatusDescription,
getMenus,
receiptPrintRawData,
receiptPrintRawDataHtml,
addReceiptData
}
service/system/useLogService.ts
import * as config from '@/config'
import { hydate, serveWebApi, LogInfo } from '@/common'
import { useSystemStore } from '@/store'
// 记录业务流水日志
const logBusinessTrace = async function (
businessTrace: string,
businessName: string,
terminalIp: string,
orgId: string,
terminalNo: string,
iDCardNo: string,
customCardNo: string,
bankCardNo: string,
customId: string,
customName: string,
telephone: string
) {
const ret = await serveWebApi('/api/System/AddLogBusinessTrace', {
businessTrace: businessTrace,
businessName: businessName,
terminalIp: terminalIp,
orgId: orgId,
terminalNo: terminalNo,
iDCardNo: iDCardNo,
customCardNo: customCardNo,
bankCardNo: bankCardNo,
customId: customId,
customName: customName,
telephone: telephone
})
return ret
}
// 记录业务流水结果
const logBusinessResult = async function (
businessTrace: string,
terminalNo: string,
patientName: string,
trace: string,
tradeAmt: string,
tradeResult: string,
tradeResultMsg: string,
flag: string,
handleInfo: string
) {
const systemStore = useSystemStore()
const tradeInfo = `${patientName},${systemStore.dictFlowKey},${2}`
const tradePageInfo = window.location.href
const ret = await serveWebApi('/api/System/AddLogBusinessResult', {
businessTrace: businessTrace,
terminalNo: terminalNo,
trace: trace,
tradeAmt: tradeAmt,
tradeInfo: tradeInfo,
tradeResult: tradeResult,
tradeResultMsg: tradeResultMsg,
tradePageInfo: tradePageInfo,
flag: flag,
handleInfo: handleInfo
})
return ret
}
// 记录业务消息
const logBusinessMsg = async function (
businessTrace: string,
msgValue: string,
msgInfo: string
) {
const systemStore = useSystemStore()
const msgPageName = systemStore.dict.currentPage.value
const msgScope = ''
const ret = await serveWebApi('/api/System/AddLogBusinessMsg', {
businessTrace: businessTrace,
msgPageName: msgPageName,
msgScope: msgScope,
msgValue: msgValue,
msgInfo: msgInfo
})
return ret
}
// 记录卡片明细
const logCardDetail = async function (
terminalNo: string,
businessTrace: string,
changeCount: string,
idCardNo: string,
customName: string,
telephone: string,
customCardNo: string,
description: string
) {
const jsonObject = {
terminalNo: terminalNo,
businessTrace: businessTrace,
changeCount: changeCount,
idCardNo: idCardNo,
customName: customName,
telephone: telephone,
customCardNo: customCardNo,
description: description
}
const jsonStr = JSON.stringify(jsonObject)
const now = new Date()
const folder = `${config.LogCardDetailDir}${hydate(now).format('YYYY-MM')}\\`
const fileName = `LogCardDetail${hydate(now).format('YYYY-MM-DD')}.txt'`
LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
const ret = await serveWebApi('/api/System/AddCardDetail', jsonObject)
return ret
}
// 记录现金明细
const logCashDetail = async function (
terminalNo: string,
businessTrace: string,
trace: string,
denomination: string,
idCardNo: string,
customName: string,
telephone: string,
customCardNo: string,
customId: string
) {
const jsonObject = {
terminalNo: terminalNo,
businessTrace: businessTrace,
trace: trace,
denomination: denomination,
idCardNo: idCardNo,
customName: customName,
telephone: telephone,
customCardNo: customCardNo,
customId: customId
}
const jsonStr = JSON.stringify(jsonObject)
const now = new Date()
const folder = `${config.LogCashDetailDir}${hydate(now).format('YYYY-MM')}\\`
const fileName = `LogCashDetail${hydate(now).format('YYYY-MM-DD')}.txt`
LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
return await serveWebApi('/api/System/AddCashDetail', jsonObject)
}
// 记录账户明细
const logAccountDetail = async function (
businessTrace: string,
terminalNo: string,
trace: string,
modeType: string,
tradeType: string,
iSEmpNo: string,
tradeAmt: string,
customCardNo: string,
customId: string,
customName: string,
bankPosId: string,
bankCardNo: string,
bankTrace: string,
bankReferenceNo: string,
bankDate: string,
bankTime: string,
bankTradeDate: string
) {
const jsonObject = {
businessTrace: businessTrace,
terminalNo: terminalNo,
trace: trace,
modeType: modeType,
tradeType: tradeType,
iSEmpNo: iSEmpNo,
tradeAmt: tradeAmt,
customCardNo: customCardNo,
customId: customId,
customName: customName,
bankPosId: bankPosId,
bankCardNo: bankCardNo,
bankTrace: bankTrace,
bankReferenceNo: bankReferenceNo,
bankDate: bankDate,
bankTime: bankTime,
bankTradeDate: bankTradeDate
}
const jsonStr = JSON.stringify(jsonObject)
const now = new Date()
const folder = `${config.LogAccountDetailDir}${hydate(now).format('YYYY-MM')}\\`
const fileName = `LogAccountDetail${hydate(now).format('YYYY-MM-DD')}.txt`
LogInfo(folder, fileName, eval("'" + jsonStr + "'") + ',')
const ret = await serveWebApi('/api/System/AddAccountDetail', jsonObject)
return ret
}
// 记录账户明细结果
const logAccountDetailResult = async function (
trace: string,
tradeResult: string,
iSTrace: string,
iSTradeDate: string
) {
const ret = await serveWebApi('/api/System/AddAccountDetailResult', {
trace: trace,
tradeResult: tradeResult,
iSTrace: iSTrace,
iSTradeDate: iSTradeDate
})
return ret
}
export {
logBusinessTrace,
logBusinessResult,
logBusinessMsg,
logCardDetail,
logCashDetail,
logAccountDetail,
logAccountDetailResult
}
service/system/useTradeServcie.ts
import { serveWebApi } from '@/common'
// 添加/更新交易信息日志
const addOrUpdateTradeInfo = async function (
TradeID: string,
TerminalNo: string,
TerminalIP: string,
TellerNo: string,
PatientCardID: string,
PatientID: string,
PatientName: string,
TradeState: string,
IdCardNo: string,
CurrentMoney: string,
TradeMoney: string,
TradeTypeID: string,
TradeNameID: string,
ProcessKey: string,
TradeType: string,
ApiState: string,
Hospital_No: string,
BusinessOrderNo: string,
ProcessId: string
) {
const ret = await serveWebApi('/api/Trade/AddOrUpdateTradeInfo', {
TradeID: TradeID,
TerminalNo: TerminalNo,
TerminalIP: TerminalIP,
TellerNo: TellerNo,
PatientCardID: PatientCardID,
PatientID: PatientID,
PatientName: PatientName,
TradeState: TradeState,
IdCardNo: IdCardNo,
CurrentMoney: CurrentMoney,
TradeMoney: TradeMoney,
TradeTypeID: TradeTypeID,
TradeNameID: TradeNameID,
ProcessKey: ProcessKey,
TradeType: TradeType,
ApiState: ApiState,
Hospital_No: Hospital_No,
BusinessOrderNo: BusinessOrderNo,
ProcessId: ProcessId
})
return ret
}
// 更新交易信息日志
const updateTradeInfo = async function (
TradeID: string,
TradeState: string,
TradeMoney: string,
BusinessOrderNo: string
) {
const ret = await serveWebApi('/api/Trade/UpdateTradeInfo', {
TradeID: TradeID,
TradeState: TradeState,
TradeMoney: TradeMoney,
BusinessOrderNo: BusinessOrderNo
})
return ret
}
// 更新交易信息状态日志
const updateTradeInfoStatus = async function (
TradeID: string,
TradeState: string
) {
const ret = await serveWebApi('/api/Trade/UpdateTradeInfoStatus', {
TradeID: TradeID,
TradeState: TradeState
})
return ret
}
// 添加交易明细日志
const addTradeDetail = async function (
InterfaceTypeID: string,
InterfaceNameID: string,
TraceNo: string,
TerminalNo: string,
TradeState: string,
pageName: string,
CurrentMoney: string,
TradeMoney: string,
TradeID: string,
ApiState: string,
ProcessIdDetails: string
) {
const ret = await serveWebApi('/api/Trade/AddTradeDetail', {
InterfaceTypeID: InterfaceTypeID,
InterfaceNameID: InterfaceNameID,
TraceNo: TraceNo,
TerminalNo: TerminalNo,
TradeState: TradeState,
pageName: pageName,
CurrentMoney: CurrentMoney,
TradeMoney: TradeMoney,
TradeID: TradeID,
ApiState: ApiState,
ProcessIdDetails: ProcessIdDetails
})
return ret
}
// 更新交易明细日志
const updateTradeDetail = async function (
TradeDetailID: number,
TradeState: string
) {
const ret = await serveWebApi('/api/Trade/UpdateTradeDetail', {
TradeDetailID: TradeDetailID,
TradeState: TradeState
})
return ret
}
// 添加交易接口日志
const addLogTrade = async function (
TradeDetailID: number,
TradeCode: string,
TradeName: string,
TradeMsg: string,
MsgType: string,
LogType: string
) {
const ret = await serveWebApi('/api/Trade/AddLogTrade', {
TradeDetailID: TradeDetailID,
TradeCode: TradeCode,
TradeName: TradeName,
TradeMsg: TradeMsg,
MsgType: MsgType,
LogType: LogType
})
return ret
}
// 添加交易订单日志
const addTradeOrder = async function (
Order_NO: string,
Order_Name: string,
Order_Amt: string,
Order_Desc: string,
Order_State: string,
Order_Creator: string,
Order_Plat: string,
Order_CreatorID: string,
Pay_OrderNO: string,
His_NO: string,
Account_ID: string,
Field1: string,
Field2: string
) {
const ret = await serveWebApi('/api/Trade/AddTradeOrder', {
Order_NO: Order_NO,
Order_Name: Order_Name,
Order_Amt: Order_Amt,
Order_Desc: Order_Desc,
Order_State: Order_State,
Order_Creator: Order_Creator,
Order_Plat: Order_Plat,
Order_CreatorID: Order_CreatorID,
Pay_OrderNO: Pay_OrderNO,
His_NO: His_NO,
Account_ID: Account_ID,
Field1: Field1,
Field2: Field2
})
return ret
}
// 更新交易订单日志
const updateTradeOrder = async function (
Order_NO: string,
Order_State: string,
Pay_OrderNO: string,
His_NO: string,
Field1: string,
Field2: string
) {
const ret = await serveWebApi('/api/Trade/UpdateTradeOrder', {
Order_NO: Order_NO,
Order_State: Order_State,
Pay_OrderNO: Pay_OrderNO,
His_NO: His_NO,
Field1: Field1,
Field2: Field2
})
return ret
}
// 添加交易记录日志
const addTradeRecord = async function (
Trade_NO: string,
Business_OrderNO: string,
Pay_OrderNO: string,
His_NO: string,
Trade_IP: string,
Trade_TerminalNO: string,
Trade_Amt: string,
Trade_Type: string,
Trade_Status: string,
Trade_GoodsType: string,
Trade_GoodsName: string,
App_ID: string,
Payment_ID: string,
Payment_TypeName: string,
Trade_Plat: string,
Trade_Code: string
) {
const ret = await serveWebApi('/api/Trade/AddTradeRecord', {
Trade_NO: Trade_NO,
Business_OrderNO: Business_OrderNO,
Pay_OrderNO: Pay_OrderNO,
His_NO: His_NO,
Trade_IP: Trade_IP,
Trade_TerminalNO: Trade_TerminalNO,
Trade_Amt: Trade_Amt,
Trade_Type: Trade_Type,
Trade_Status: Trade_Status,
Trade_GoodsType: Trade_GoodsType,
Trade_GoodsName: Trade_GoodsName,
App_ID: App_ID,
Payment_ID: Payment_ID,
Payment_TypeName: Payment_TypeName,
Trade_Plat: Trade_Plat,
Trade_Code: Trade_Code
})
return ret
}
// 更新交易记录日志
const updateTradeRecord = async function (
Trade_NO: string,
His_NO: string,
Trade_Status: string
) {
const ret = await serveWebApi('/api/Trade/UpdateTradeRecord', {
Trade_NO: Trade_NO,
His_NO: His_NO,
Trade_Status: Trade_Status
})
return ret
}
// 添加退费记录日志
const addRefundRecord = async function (
Pay_OrderNO: string,
Refund_NO: string,
Business_OrderNO: string,
Refund_Amt: string,
Refund_Status: string,
Refund_Desc: string,
Trade_NO: string,
App_ID: string
) {
const ret = await serveWebApi('/api/Trade/AddRefundRecord', {
Pay_OrderNO: Pay_OrderNO,
Refund_NO: Refund_NO,
Business_OrderNO: Business_OrderNO,
Refund_Amt: Refund_Amt,
Refund_Status: Refund_Status,
Refund_Desc: Refund_Desc,
Trade_NO: Trade_NO,
App_ID: App_ID
})
return ret
}
// 更新退费记录日志
const updateRefundRecord = async function (
Refund_NO: string,
Refund_Status: string
) {
const ret = await serveWebApi('/api/Trade/UpdateRefundRecord', {
Refund_NO: Refund_NO,
Refund_Status: Refund_Status
})
return ret
}
export {
addOrUpdateTradeInfo,
updateTradeInfo,
updateTradeInfoStatus,
addTradeDetail,
updateTradeDetail,
addLogTrade,
addTradeOrder,
updateTradeOrder,
addTradeRecord,
updateTradeRecord,
addRefundRecord,
updateRefundRecord
}
service/system/useManageServcie.ts
import { serveWebApi } from '@/common'
import { useSystemStore } from '@/store/useSystemStore'
// 获取前台管理菜单
const getManageMenus = async function (xmlFile: string) {
const ret = await serveWebApi('/api/System/getManageMenus', {
xmlFile: xmlFile
})
return ret
}
// 更新终端状态
const updateTerminalStatus = async function (
status: string,
id: string,
operUserId: string
) {
const ret = await serveWebApi('/api/Terminal/UpdateTerminalStatus', {
status: status,
id: id,
operUserId: operUserId
})
if (ret == true) {
const systemStore = useSystemStore()
systemStore.syncDictTerminal('Status', status)
}
return ret
}
// 更新物料用量当前数量
const changeSuppliesUsageCurrentCount = async function (
suppliesName: string,
terminalNo: string,
changeCount: number
) {
const ret = await serveWebApi(
'/api/Terminal/ChangeSuppliesUsageCurrentCount',
{
suppliesName: suppliesName,
terminalNo: terminalNo,
changeCount: changeCount
}
)
return ret
}
// 获取在用物料用量信息
const getSuppliesUsageInUse = async function (
suppliesName: string,
terminalNo: string
) {
const ret = await serveWebApi('/api/Terminal/GetSuppliesUsageInUse', {
suppliesName: suppliesName,
terminalNo: terminalNo
})
return ret
}
// 更新物料用量信息
const changeSuppliesUsage = async function (
suppliesName: string,
terminalNo: string,
currentCount: string,
warningThreshold: string,
userId: string
) {
const ret = await serveWebApi('/api/Terminal/ChangeSuppliesUsage', {
suppliesName: suppliesName,
terminalNo: terminalNo,
currentCount: currentCount,
warningThreshold: warningThreshold,
userId: userId
})
return ret
}
// 获取数据库数据
const getDBData = async function (
Tables: string,
PrimaryKey: string,
Fields: string,
Filter: string,
Group: string,
Sort: string
) {
const ret = await serveWebApi('/api/DB/GetData', {
Tables: Tables,
PrimaryKey: PrimaryKey,
Fields: Fields,
Filter: Filter,
Group: Group,
Sort: Sort
})
return ret
}
// 获取数据库分页数据
const getDBPagingData = async function (
jsonSelectConfig: object,
pageSize: string,
pageIndex: string
) {
const ret = await serveWebApi('/api/DB/GetPagingData', {
jsonSelectConfig: jsonSelectConfig,
pageSize: pageSize,
pageIndex: pageIndex
})
return ret
}
// 检查现金批次
const checkCashBatch = async function (terminalNo: string) {
const ret = await serveWebApi('/api/System/CheckCashBatch', {
terminalNo: terminalNo
})
return ret
}
// 现金清理
const cashClean = async function (
terminalNo: string,
userId: string,
batchId: string
) {
const ret = await serveWebApi('/api/System/CashClean', {
terminalNo: terminalNo,
userId: userId,
batchId: batchId
})
return ret
}
// 现金结账
const cashSettle = async function (terminalNo: string, userId: string) {
const ret = await serveWebApi('/api/System/CashSettle', {
terminalNo: terminalNo,
userId: userId
})
return ret
}
// 更新业务数据处理信息
const updateLogBusinessHandleInfo = async function (
trace: string,
handleUserId: string,
handleInfo: string
) {
const ret = await serveWebApi('/api/System/UpdateLogBusinessHandleInfo', {
trace: trace,
handleUserId: handleUserId,
handleInfo: handleInfo
})
return ret
}
// 验证用户名和密码
const checkUserNameAndPassword = async function (
userName: string,
password: string
) {
const ret = await serveWebApi('/api/System/CheckUserNameAndPassword', {
userName: userName,
password: password
})
return ret
}
// 通过用户名获取用户信息
const getUserByUserName = async function (userName: string) {
const ret = await serveWebApi('/api/System/GetUserByUserName', {
userName: userName,
loginCardNo: ''
})
return ret
}
// 验证登录卡号
const checkUserLoginCardNo = async function (loginCardNo: string) {
const ret = await serveWebApi('/api/System/CheckUserLoginCardNo', {
userName: '',
loginCardNo: loginCardNo
})
return ret
}
// 通过登录卡号获取用户信息
const getUserByLoginCardNo = async function (loginCardNo: string) {
const ret = await serveWebApi('/api/System/GetUserByLoginCardNo', {
userName: '',
loginCardNo: loginCardNo
})
return ret
}
export {
getManageMenus,
updateTerminalStatus,
changeSuppliesUsageCurrentCount,
getSuppliesUsageInUse,
changeSuppliesUsage,
getDBData,
getDBPagingData,
checkCashBatch,
cashClean,
cashSettle,
updateLogBusinessHandleInfo,
checkUserNameAndPassword,
getUserByUserName,
checkUserLoginCardNo,
getUserByLoginCardNo
}
service/system/useOtherService.ts
import { serveWebApi } from '@/common'
// 获取文件内容
const getFileContent = async function (filePath: string) {
const ret = await serveWebApi('/api/System/GetFileContent', {
strPath: filePath
})
return ret
}
// 银行前置服务
const bankTvm = async function (IP: string, Port: string, _inStr: string) {
const ret = await serveWebApi('/api/System/BankTvm', {
IP: IP,
Port: Port,
_inStr: _inStr
})
return ret
}
// 记录服务器日志
const writeSSTSLog = async function (
terminalIp: string,
prefix: string,
subDir: string,
log: string
) {
const ret = await serveWebApi('/api/System/WriteSSTSLog', {
terminalIp: terminalIp,
prefix: prefix,
subDir: subDir,
log: log
})
return ret
}
export { getFileContent, bankTvm, writeSSTSLog }
二、调用示例
无
三、运行测试
无