|
|
@@ -204,7 +204,7 @@ export class TaskShuyouService extends BaseService {
|
|
|
this.logger.info('syncTargetAndComplete>>>' + updateTime);
|
|
|
let sheepData = [];
|
|
|
let wslData = [];
|
|
|
- // let computerRoomData = []
|
|
|
+ let computerRoomData = [];
|
|
|
let newComputerRoomData = [];
|
|
|
// let oldService = []
|
|
|
let flag = {
|
|
|
@@ -257,18 +257,18 @@ export class TaskShuyouService extends BaseService {
|
|
|
} else {
|
|
|
sheepData = [];
|
|
|
}
|
|
|
- // let data2 = await queryComputerRoom(new_date)
|
|
|
- // console.log(data2)
|
|
|
- // if (_.isEmpty(data2) || data2 == -1) {
|
|
|
- // // this.logger.warn('老机房后台数据错误')
|
|
|
- // flag.detail = '老机房后台数据错误'
|
|
|
- // flag.status = 0
|
|
|
- // await this.ShuyouTargetFlagService.add(flag)
|
|
|
- // // return 'syncTargetAndComplete >>> 老机房后台数据错误 >>> ' + updateTime;
|
|
|
- // computerRoomData = []
|
|
|
- // } else {
|
|
|
- // computerRoomData = JSON.parse(data2 + '')
|
|
|
- // }
|
|
|
+ let data2 = await queryComputerRoom(new_date);
|
|
|
+ console.log(data2);
|
|
|
+ if (_.isEmpty(data2) || data2 == -1) {
|
|
|
+ // this.logger.warn('老机房后台数据错误')
|
|
|
+ flag.detail = '老机房后台数据错误';
|
|
|
+ flag.status = 0;
|
|
|
+ await this.ShuyouTargetFlagService.add(flag);
|
|
|
+ // return 'syncTargetAndComplete >>> 老机房后台数据错误 >>> ' + updateTime;
|
|
|
+ computerRoomData = [];
|
|
|
+ } else {
|
|
|
+ computerRoomData = JSON.parse(data2 + '');
|
|
|
+ }
|
|
|
let data3 = await queryNewComputerRoom(new_date);
|
|
|
// console.log(data3)
|
|
|
if (_.isEmpty(data3) || data3 == -1) {
|
|
|
@@ -444,6 +444,17 @@ export class TaskShuyouService extends BaseService {
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
+ for (let oldvalue of computerRoomData) {
|
|
|
+ if (task_name == oldvalue.game_name) {
|
|
|
+ complete_new += oldvalue.new_complete_local;
|
|
|
+ complete_pay += oldvalue.pay_complete_local;
|
|
|
+ complete_active =
|
|
|
+ complete_active +
|
|
|
+ oldvalue.retained_complete_local +
|
|
|
+ oldvalue.new_complete_local;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (flag4 == 0) {
|
|
|
let flag10 = 0;
|
|
|
// if (oldServiceErr == false) {
|
|
|
@@ -798,7 +809,7 @@ export class TaskShuyouService extends BaseService {
|
|
|
this.logger.info('suncYesterdayAll>>>' + updateTime);
|
|
|
let sheepData = [];
|
|
|
let wslData = [];
|
|
|
- // let computerRoomData = []
|
|
|
+ let computerRoomData = [];
|
|
|
let newComputerRoomData = [];
|
|
|
// let oldService = []
|
|
|
// 先删除reason_incomplete表中昨日所有未完成数据,下面会重新添加
|
|
|
@@ -839,12 +850,12 @@ export class TaskShuyouService extends BaseService {
|
|
|
// this.logger.info(sheepData)
|
|
|
// this.logger.info('获取小绵羊后台数据成功')
|
|
|
}
|
|
|
- // let data2 = await queryComputerRoom(yest_date)
|
|
|
- // if (_.isEmpty(data2) || data2 == -1) {
|
|
|
- // computerRoomData = []
|
|
|
- // } else {
|
|
|
- // computerRoomData = JSON.parse(data2 + '')
|
|
|
- // }
|
|
|
+ let data2 = await queryComputerRoom(yest_date);
|
|
|
+ if (_.isEmpty(data2) || data2 == -1) {
|
|
|
+ computerRoomData = [];
|
|
|
+ } else {
|
|
|
+ computerRoomData = JSON.parse(data2 + '');
|
|
|
+ }
|
|
|
let data3 = await queryNewComputerRoom(yest_date);
|
|
|
if (_.isEmpty(data3) || data3 == -1) {
|
|
|
newComputerRoomData = [];
|
|
|
@@ -958,6 +969,17 @@ export class TaskShuyouService extends BaseService {
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
+ for (let oldvalue of computerRoomData) {
|
|
|
+ if (oldvalue.game_name == task_name) {
|
|
|
+ complete_new += oldvalue.new_complete_local;
|
|
|
+ complete_pay += oldvalue.pay_complete_local;
|
|
|
+ complete_active =
|
|
|
+ complete_active +
|
|
|
+ oldvalue.retained_complete_local +
|
|
|
+ oldvalue.new_complete_local;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (flag4 == 0) {
|
|
|
var flag6 = 0;
|
|
|
// for (let value of oldService) {
|
|
|
@@ -1636,25 +1658,30 @@ let queryXmyPay = function (new_date, xmy_id) {
|
|
|
return pm;
|
|
|
};
|
|
|
// 获取机房游戏数据
|
|
|
-// let queryComputerRoom = function (new_date) {
|
|
|
-// var url = 'http://182.150.53.148:6005//v1/task_statistics?query=date:' + new_date + ',type:machine'
|
|
|
-// var http = require('http');
|
|
|
-// var pm = new Promise(function (resolve, reject) {
|
|
|
-// http.get(url, function (res) {
|
|
|
-// var html = '';
|
|
|
-// res.on('data', function (d) {
|
|
|
-// html += d.toString()
|
|
|
-// });
|
|
|
-// res.on('end', function () {
|
|
|
-// resolve(html);
|
|
|
-// });
|
|
|
-// }).on('error', function (e) {
|
|
|
-// // reject(e)
|
|
|
-// resolve(-1)
|
|
|
-// });
|
|
|
-// });
|
|
|
-// return pm;
|
|
|
-// }
|
|
|
+let queryComputerRoom = function (new_date) {
|
|
|
+ var url =
|
|
|
+ 'http://182.150.53.148:6007//v1/task_statistics?query=date:' +
|
|
|
+ new_date +
|
|
|
+ ',type:machine';
|
|
|
+ var http = require('http');
|
|
|
+ var pm = new Promise(function (resolve, reject) {
|
|
|
+ http
|
|
|
+ .get(url, function (res) {
|
|
|
+ var html = '';
|
|
|
+ res.on('data', function (d) {
|
|
|
+ html += d.toString();
|
|
|
+ });
|
|
|
+ res.on('end', function () {
|
|
|
+ resolve(html);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .on('error', function (e) {
|
|
|
+ // reject(e)
|
|
|
+ resolve(-1);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return pm;
|
|
|
+};
|
|
|
// 获取新机房游戏数据
|
|
|
let queryNewComputerRoom = function (new_date) {
|
|
|
var url =
|