123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 'use strict';
- /**
- *
- *
- * @author Mai
- * @date 2018/9/26
- * @version
- */
- module.exports = app => {
- class SpecPull extends app.BaseService {
- /**
- * 构造函数
- *
- * @param {Object} ctx - egg全局变量
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 's2b_spec_pull';
- }
- async syncLedger (pid) {
- const pull = await this.getDataByCondition({ pid, valid: 1, pull_type: 'sync-ledger' });
- return pull;
- }
- async syncRevise(pid) {
- const pull = await this.getDataByCondition({ pid, valid: 1, pull_type: 'sync-revise' });
- return pull;
- }
- async loadWbsFile(pid) {
- const pull = await this.getDataByCondition({ pid, valid: 1, pull_type: 'load-wbs-info' });
- if (pull) {
- pull.extra_option = pull.extra_option ? JSON.parse(pull.extra_option) : {};
- delete pull.info;
- }
- return pull;
- }
- }
- return SpecPull;
- };
|