feat: 积分商城-供应商-对账
This commit is contained in:
@@ -16,6 +16,8 @@ import { orderListService } from '../services/order-list.service.js'
|
||||
import { orderPushEventService, type OrderPushEventInput } from '../services/order-push-event.service.js'
|
||||
import {
|
||||
supplierOpenOrderService,
|
||||
type SupplierInvoiceApplyRequest,
|
||||
type SupplierInvoiceQueryRequest,
|
||||
type SupplierOrderQueryRequest,
|
||||
type SupplierReconciliationQueryRequest
|
||||
} from '../services/supplier-open-order.service.js'
|
||||
@@ -261,3 +263,37 @@ export const supplierReconciliationInfoController = withErrorBoundary(async (req
|
||||
|
||||
return Response.json(await supplierOpenOrderService.queryReconciliationInfo(body))
|
||||
})
|
||||
|
||||
export const supplierInvoiceApplyController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
const methodResponse = guardMethod(request, ['POST'])
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
let body: SupplierInvoiceApplyRequest
|
||||
try {
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceApplyRequest>(request)) as SupplierInvoiceApplyRequest
|
||||
} catch (error) {
|
||||
return Response.json({
|
||||
resultCode: 400,
|
||||
message: error instanceof Error ? error.message : '请求参数解密失败'
|
||||
})
|
||||
}
|
||||
|
||||
return Response.json(await supplierOpenOrderService.applyForInvoices(body))
|
||||
})
|
||||
|
||||
export const supplierInvoiceInfoController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
const methodResponse = guardMethod(request, ['POST'])
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
let body: SupplierInvoiceQueryRequest
|
||||
try {
|
||||
body = supplierOpenOrderService.parseBody(await readJson<SupplierInvoiceQueryRequest>(request)) as SupplierInvoiceQueryRequest
|
||||
} catch (error) {
|
||||
return Response.json({
|
||||
resultCode: 400,
|
||||
message: error instanceof Error ? error.message : '请求参数解密失败'
|
||||
})
|
||||
}
|
||||
|
||||
return Response.json(await supplierOpenOrderService.queryInvoicesInfo(body))
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ type SupplierInfoRequest = {
|
||||
}
|
||||
|
||||
type SupplierTokenRequest = {
|
||||
userId?: string
|
||||
AplParmObjct?: string
|
||||
supplierIdentification?: string
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ export const supplierTokenController = withErrorBoundary(async (request: Request
|
||||
if (methodResponse) return methodResponse
|
||||
|
||||
const body = await readJson<SupplierTokenRequest>(request)
|
||||
const userId = String(body.userId || '').trim()
|
||||
const encryptedParam = String(body.AplParmObjct || '').trim()
|
||||
const supplierIdentification = String(body.supplierIdentification || '').trim().toLowerCase()
|
||||
|
||||
return toHttpResponse(await supplierService.warmSupplierToken(userId, supplierIdentification))
|
||||
return toHttpResponse(await supplierService.warmSupplierToken(encryptedParam, supplierIdentification))
|
||||
})
|
||||
|
||||
export const supplierPointsController = withErrorBoundary(async (request: Request, _context: Context) => {
|
||||
|
||||
Reference in New Issue
Block a user