34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const MainService = require('../../main');
|
|
|
|
class StorageTransactionService extends MainService {
|
|
constructor(ctx) {
|
|
super(ctx);
|
|
const _noNeedLogin = '';
|
|
const _noNeedRight = 'list';
|
|
const _noNeedLog = 'list';
|
|
const _noNeedAuth = 'list';
|
|
this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth);
|
|
}
|
|
|
|
/**
|
|
* 出入库记录列表查询,支持 where 条件、分页、排序。
|
|
* @param {Object} data 请求体
|
|
* @param {Object} [data.where] 查询条件
|
|
* @param {Object} [data.pagination] 分页参数 { page, pageSize }
|
|
* @param {Object} [data.sort] 排序参数 { sortField, sortOrder }
|
|
* @param {boolean} [data.group_by_batch=false] 是否按批次查询明细
|
|
* @return {Promise<Object>} 统一 success 包装
|
|
*/
|
|
async list(data = {}) {
|
|
const { service } = this;
|
|
const { pagination, sort, group_by_batch } = data;
|
|
this.prepareWhereContext(data);
|
|
const result = await service.systems.stockTransaction.list(pagination, sort, group_by_batch);
|
|
return this.success('ok', result);
|
|
}
|
|
}
|
|
|
|
module.exports = StorageTransactionService;
|