Commit 3bb20aca authored by 何娜's avatar 何娜

taxh5 拉数据优化

parent 5c96b54d
Pipeline #7082 passed with stage
in 2 seconds
......@@ -97,11 +97,16 @@ class OrderController extends Controller {
async partnerData() {
const {ctx, service} = this;
ctx.validate(this.showRule);
const {appKey, orderSn} = ctx.request.body.params;
let {appKey, orderSn, orderId} = ctx.request.body.params;
orderId = orderId || orderSn;
const appKeyInfo = await service.partner.fetchInfo(appKey);
if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableHfData === true)) {
return ctx.fail('未开通此服务');
}
await service.signature.signatureCheck(ctx.request.body);
const data = await service.order.getOneByOrderId(orderSn);
if (data && data.status === 'success') {
const result = await service.storage.read(orderSn, appKey);
const data = await service.order.getOneByOrderId({ orderId, status: 'success' });
if (data) {
const result = await service.storage.read(orderId, appKey);
ctx.body = {
code: 0,
data: result
......@@ -121,8 +126,7 @@ class OrderController extends Controller {
if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableItView === true)) {
return ctx.fail('未开通此服务');
}
const data = await service.order.getOneByOrderId(orderId);
ctx.logger.info('【orderShow】 getOneByOrderId', data)
const data = await service.order.getOneByOrderId({orderId, status: 'success' });
if (data) {
if (data.status === 'success' && (data.appkey === appKey)) {
const result = await service.storage.read(orderId, appKey);
......
......@@ -125,14 +125,8 @@ class PartnerService extends Service {
async notice(order) {
const {ctx, service} = this;
ctx.logger.info('【notice】order------',order);
const {orderId, notifyUrl, userId, notice} = order;
ctx.logger.info('【notice】orderId------',orderId);
ctx.logger.info('【notice】notifyUrl------',notifyUrl);
ctx.logger.info('【notice】userId------',userId);
ctx.logger.info('【notice】notice------',notice);
const dbRes = await service.order.getOneByOrderId({ orderId, notice: 1 });
ctx.logger.info('【notice】dbRes------',dbRes);
if (!dbRes && notifyUrl && notice !== '1') {
try {
const ret = await ctx.curl(notifyUrl, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment