feat: 积分商城-供应商-对账-发票
This commit is contained in:
@@ -16,6 +16,7 @@ import { orderListService } from '../services/order-list.service.js'
|
||||
import { orderPushEventService, type OrderPushEventInput } from '../services/order-push-event.service.js'
|
||||
import {
|
||||
supplierOpenOrderService,
|
||||
type SupplierFileBase64QueryRequest,
|
||||
type SupplierInvoiceApplyRequest,
|
||||
type SupplierInvoiceQueryRequest,
|
||||
type SupplierOrderQueryRequest,
|
||||
@@ -270,7 +271,7 @@ export const supplierInvoiceApplyController = withErrorBoundary(async (request:
|
||||
|
||||
let body: SupplierInvoiceApplyRequest
|
||||
try {
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceApplyRequest>(request)) as SupplierInvoiceApplyRequest
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceApplyRequest>(request))
|
||||
} catch (error) {
|
||||
return Response.json({
|
||||
resultCode: 400,
|
||||
@@ -287,7 +288,7 @@ export const supplierInvoiceInfoController = withErrorBoundary(async (request: R
|
||||
|
||||
let body: SupplierInvoiceQueryRequest
|
||||
try {
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceQueryRequest>(request)) as SupplierInvoiceQueryRequest
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceQueryRequest>(request))
|
||||
} catch (error) {
|
||||
return Response.json({
|
||||
resultCode: 400,
|
||||
@@ -295,5 +296,24 @@ export const supplierInvoiceInfoController = withErrorBoundary(async (request: R
|
||||
})
|
||||
}
|
||||
|
||||
return Response.json(await supplierOpenOrderService.queryInvoicesInfo(body))
|
||||
return Response.json(await supplierOpenOrderService.queryInvoiceInfo(body))
|
||||
})
|
||||
|
||||
export const supplierFileBase64InfoController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
const methodResponse = guardMethod(request, ['POST'])
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
let body: SupplierFileBase64QueryRequest
|
||||
try {
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierFileBase64QueryRequest>(request))
|
||||
} catch (error) {
|
||||
return Response.json({
|
||||
resultCode: 400,
|
||||
message: error instanceof Error ? error.message : '请求参数解密失败',
|
||||
fileType: 'JPG',
|
||||
imageEncodeMap: {}
|
||||
})
|
||||
}
|
||||
|
||||
return Response.json(await supplierOpenOrderService.queryFileBase64Info(body))
|
||||
})
|
||||
|
||||
@@ -9,8 +9,12 @@ type SupplierInfoRequest = {
|
||||
supplierIdentification?: string
|
||||
}
|
||||
|
||||
type SupplierSessionRequest = {
|
||||
keyword?: string
|
||||
}
|
||||
|
||||
type SupplierTokenRequest = {
|
||||
AplParmObjct?: string
|
||||
userId?: string
|
||||
supplierIdentification?: string
|
||||
}
|
||||
|
||||
@@ -34,15 +38,25 @@ export const supplierInfoController = withErrorBoundary(async (request: Request,
|
||||
return toHttpResponse(await supplierService.getSupplierInfo(supplierIdentification))
|
||||
})
|
||||
|
||||
export const supplierSessionController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
const methodResponse = guardMethod(request, ['POST'])
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
const body = await readJson<SupplierSessionRequest>(request)
|
||||
const keyword = String(body.keyword || '')
|
||||
|
||||
return toHttpResponse(supplierService.decryptSupplierSession(keyword))
|
||||
})
|
||||
|
||||
export const supplierTokenController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
const methodResponse = guardMethod(request, ['POST'])
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
const body = await readJson<SupplierTokenRequest>(request)
|
||||
const encryptedParam = String(body.AplParmObjct || '').trim()
|
||||
const userId = String(body.userId || '').trim()
|
||||
const supplierIdentification = String(body.supplierIdentification || '').trim().toLowerCase()
|
||||
|
||||
return toHttpResponse(await supplierService.warmSupplierToken(encryptedParam, supplierIdentification))
|
||||
return toHttpResponse(await supplierService.warmSupplierToken(userId, supplierIdentification))
|
||||
})
|
||||
|
||||
export const supplierPointsController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
|
||||
Reference in New Issue
Block a user