Prechádzať zdrojové kódy

删除不必要的文件

yangkaihong 3 rokov pred
rodič
commit
dfb250ad9d
100 zmenil súbory, kde vykonal 3369 pridanie a 5136 odobranie
  1. 0 0
      .gitignore
  2. 29 33
      cool-admin-midway-master/README.md
  3. BIN
      cool-admin-midway-master/node_modules.zip
  4. 2 2
      cool-admin-midway-master/package.json
  5. 32 0
      cool-admin-midway-master/src/app/comm/utils.ts
  6. 8 1
      cool-admin-midway-master/src/app/modules/README.md
  7. 1 0
      cool-admin-midway-master/src/app/modules/base/service/sys/login.ts
  8. 0 23
      cool-admin-midway-master/src/app/modules/hide/config.ts
  9. 0 51
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_account_type.ts
  10. 0 232
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_account.ts
  11. 0 81
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_agent.ts
  12. 0 54
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_director.ts
  13. 0 58
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_list.ts
  14. 0 65
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_target.ts
  15. 0 149
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_task.ts
  16. 0 79
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_lo_mode.ts
  17. 0 265
      cool-admin-midway-master/src/app/modules/hide/controller/app/game_task.ts
  18. 0 25
      cool-admin-midway-master/src/app/modules/hide/entity/hide_account_type.ts
  19. 0 75
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account.ts
  20. 0 27
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account_record.ts
  21. 0 27
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account_temp.ts
  22. 0 30
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_agent.ts
  23. 0 134
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_complete.ts
  24. 0 46
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_director.ts
  25. 0 32
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_list.ts
  26. 0 134
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_target.ts
  27. 0 135
      cool-admin-midway-master/src/app/modules/hide/entity/hide_game_task.ts
  28. 0 29
      cool-admin-midway-master/src/app/modules/hide/entity/hide_lo_mode.ts
  29. 0 57
      cool-admin-midway-master/src/app/modules/hide/entity/hide_task_account_record.ts
  30. 0 27
      cool-admin-midway-master/src/app/modules/hide/entity/hide_task_game_record.ts
  31. 0 111
      cool-admin-midway-master/src/app/modules/hide/service/createTable.ts
  32. 0 144
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_account.ts
  33. 0 52
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_account_record.ts
  34. 0 72
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_account_temp.ts
  35. 0 115
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_agent.ts
  36. 0 53
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_complete.ts
  37. 0 96
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_director.ts
  38. 0 63
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_list.ts
  39. 0 298
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_target.ts
  40. 0 515
      cool-admin-midway-master/src/app/modules/hide/service/hide_game_task.ts
  41. 0 95
      cool-admin-midway-master/src/app/modules/hide/service/hide_lo_mode.ts
  42. 0 105
      cool-admin-midway-master/src/app/modules/hide/service/hide_task_account_record.ts
  43. 0 16
      cool-admin-midway-master/src/app/modules/news/config.ts
  44. 0 35
      cool-admin-midway-master/src/app/modules/news/controller/admin/articles.ts
  45. 0 63
      cool-admin-midway-master/src/app/modules/news/controller/admin/categories.ts
  46. 0 64
      cool-admin-midway-master/src/app/modules/news/controller/public/categories.ts
  47. 0 53
      cool-admin-midway-master/src/app/modules/news/entity/articles.ts
  48. 0 25
      cool-admin-midway-master/src/app/modules/news/entity/categories.ts
  49. 0 36
      cool-admin-midway-master/src/app/modules/news/service/articles.ts
  50. 16 32
      cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_account_record.ts
  51. 89 0
      cool-admin-midway-master/src/app/modules/shuyou/controller/admin/data_abnormal_rate.ts
  52. 29 2
      cool-admin-midway-master/src/app/modules/shuyou/controller/admin/data_active.ts
  53. 73 11
      cool-admin-midway-master/src/app/modules/shuyou/controller/admin/game_target.ts
  54. 50 0
      cool-admin-midway-master/src/app/modules/shuyou/controller/admin/robot_enterprise_wechat.ts
  55. 52 7
      cool-admin-midway-master/src/app/modules/shuyou/controller/admin/utils.ts
  56. 5 3
      cool-admin-midway-master/src/app/modules/shuyou/controller/app/game_task.ts
  57. 1 1
      cool-admin-midway-master/src/app/modules/shuyou/controller/app/idcard.ts
  58. 48 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/data_23.ts
  59. 86 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/data_abnormal_rate.ts
  60. 69 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/game_complete_hand.ts
  61. 32 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/game_complete_hand_card.ts
  62. 6 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/game_task.ts
  63. 31 0
      cool-admin-midway-master/src/app/modules/shuyou/entity/robot_enterprise_wechat.ts
  64. 49 0
      cool-admin-midway-master/src/app/modules/shuyou/service/data_23.ts
  65. 116 0
      cool-admin-midway-master/src/app/modules/shuyou/service/data_abnormal_rate.ts
  66. 68 5
      cool-admin-midway-master/src/app/modules/shuyou/service/data_active.ts
  67. 130 0
      cool-admin-midway-master/src/app/modules/shuyou/service/game_complete_hand.ts
  68. 267 6
      cool-admin-midway-master/src/app/modules/shuyou/service/game_target.ts
  69. 3 0
      cool-admin-midway-master/src/app/modules/shuyou/service/game_target_tencent.ts
  70. 178 8
      cool-admin-midway-master/src/app/modules/shuyou/service/game_task.ts
  71. 19 1
      cool-admin-midway-master/src/app/modules/shuyou/service/reason_incomplete.ts
  72. 27 0
      cool-admin-midway-master/src/app/modules/shuyou/service/robot_enterprise_wechat.ts
  73. 123 2
      cool-admin-midway-master/src/app/modules/shuyou/service/utils.ts
  74. 327 0
      cool-admin-midway-master/src/app/modules/shuyou/service/utils_xjf.ts
  75. 595 319
      cool-admin-midway-master/src/app/modules/task/service/shuyou.ts
  76. 770 0
      cool-admin-midway-master/src/app/modules/task/service/xjf_log_task.ts
  77. 3 3
      cool-admin-midway-master/src/config/config.default.ts
  78. 2 2
      cool-admin-midway-master/src/welcome.ts
  79. 7 45
      cool-admin-vue-vue3-ts-vite/README.md
  80. 0 0
      cool-admin-vue-vue3-ts-vite/package-lock-2.json
  81. 1 1
      cool-admin-vue-vue3-ts-vite/package.json
  82. 4 2
      cool-admin-vue-vue3-ts-vite/src/App.vue
  83. 3 4
      cool-admin-vue-vue3-ts-vite/src/assets/css/element-variables.scss
  84. 1 1
      cool-admin-vue-vue3-ts-vite/src/config/env.ts
  85. 11 1
      cool-admin-vue-vue3-ts-vite/src/cool/modules/base/pages/error-page/components/error-page.vue
  86. 6 13
      cool-admin-vue-vue3-ts-vite/src/cool/modules/chat/components/chat.vue
  87. 0 110
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/adv-search-target.vue
  88. 0 121
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/adv-search.vue
  89. 0 65
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideAccountType-select.vue
  90. 0 65
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameAgent-select.vue
  91. 0 66
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameDirector-select.vue
  92. 0 71
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameDirectorName-select.vue
  93. 0 71
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameList-select.vue
  94. 0 65
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameTask-select.vue
  95. 0 65
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideLoMode-select.vue
  96. 0 25
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/index.ts
  97. 0 45
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/query-isfinish.vue
  98. 0 1
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/directives/index.ts
  99. 0 15
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/index.ts
  100. 0 0
      cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/pages/index.ts

+ 0 - 0
.gitignore


+ 29 - 33
cool-admin-midway-master/README.md

@@ -1,15 +1,11 @@
 <!--
  * @Author: YKH
  * @Date: 2021-12-08 10:23:31
- * @LastEditTime: 2022-05-09 18:55:50
+ * @LastEditTime: 2022-08-03 11:24:49
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\README.md
 -->
-
-####
-game_task新增字段mz_channel,mz_id.需要手动添加至数据库
-
-
+ 
 ## Node版后台基础框架基于Egg.js
 
 # 基础:egg.js
@@ -18,33 +14,6 @@ game_task新增字段mz_channel,mz_id.需要手动添加至数据库
 # 鉴权:egg-jwt
 # 网络:axios
 
-## 运行
-rm -rf node_modules
-rm package-lock.json
-npm cache clear --force
-npm install
-
-
-
-npm run start
-lsof -i:8001
-netstat -tunlp | grep 8001
-
-curl 'http://127.0.0.1:8001'
-
-
-SERVER需要单独安装axios
-cd /home/cool/server
-npm i axios
-//
-npm install qiniu
-//
-
-//前端
-//yarn add spark-md5
-//yarn add sha1-file-web
-yarn add qiniu-js
-
 #### 修改数据库配置,配置文件位于`src/config/config.local.ts`
 
 数据库为mysql(`>=5.7版本`),node版本(`>=12.x`),首次启动会自动初始化并导入数据
@@ -96,3 +65,30 @@ $ npm stop
 
 
 [midway]: https://midwayjs.org
+
+
+## 个人记录
+- rm -rf node_modules
+- rm package-lock.json
+- npm cache clear --force
+- npm install
+
+
+
+- npm run start
+- lsof -i:8001
+- netstat -tunlp | grep 8001
+
+- curl 'http://127.0.0.1:8001'
+
+
+- SERVER需要单独安装axios
+- cd /home/cool/server
+- npm i axios
+- // npm install qiniu
+
+- 前端
+- // yarn add spark-md5
+- // yarn add sha1-file-web
+- yarn add qiniu-js
+

BIN
cool-admin-midway-master/node_modules.zip


+ 2 - 2
cool-admin-midway-master/package.json

@@ -1,7 +1,7 @@
 {
     "name": "cool-admin",
     "version": "3.0.0",
-    "description": "",
+    "description": "数优管理平台",
     "private": true,
     "dependencies": {
         "@cool-midway/qiniu": "^1.0.1",
@@ -89,4 +89,4 @@
     },
     "author": "cool-js.com",
     "license": "MIT"
-}
+}

+ 32 - 0
cool-admin-midway-master/src/app/comm/utils.ts

@@ -100,6 +100,38 @@ export class Utils {
     return Year + '-' + Months + '-' + Day;
   }
   /**
+   * 获取指定格式日期YYYY-MM-DD
+   * @param {*} date
+   * @return {*} 
+   * @memberof Utils
+   */
+  formatDateTime(date) {
+    //三目运算符
+    const Dates = new Date(date);
+
+    //年份
+    const Year: number = Dates.getFullYear();
+
+    //月份下标是0-11
+    const Months: any = (Dates.getMonth() + 1) < 10 ? '0' + (Dates.getMonth() + 1) : (Dates.getMonth() + 1);
+
+    //具体的天数
+    const Day: any = Dates.getDate() < 10 ? '0' + Dates.getDate() : Dates.getDate();
+
+    //小时
+    const Hours = Dates.getHours() < 10 ? '0' + Dates.getHours() : Dates.getHours();
+
+    //  //分钟
+    const Minutes = Dates.getMinutes() < 10 ? '0' + Dates.getMinutes() : Dates.getMinutes();
+
+    //  //秒
+    const Seconds = Dates.getSeconds() < 10 ? '0' + Dates.getSeconds() : Dates.getSeconds();
+
+    //返回数据格式
+    //  return Year + '-' + Months + '-' + Day + '-' + Hours + ':' + Minutes + ':' + Seconds; 
+    return Year + '-' + Months + '-' + Day + ' ' + Hours + ':' + Minutes + ':' + Seconds;
+  }
+  /**
    * 两个时间相差天数 
    * sDate1和sDate2是2006-12-18格式 
    * @param {*} sDate1

+ 8 - 1
cool-admin-midway-master/src/app/modules/README.md

@@ -1 +1,8 @@
-这里编写模块代码, 如系统模块、电商的商品模块等
+<!--
+ * @Author: YKH
+ * @Date: 2021-12-08 10:26:27
+ * @LastEditTime: 2022-08-03 11:20:09
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\README.md
+-->
+# 这里编写模块代码, 如系统模块、电商的商品模块等

+ 1 - 0
cool-admin-midway-master/src/app/modules/base/service/sys/login.ts

@@ -115,6 +115,7 @@ export class BaseSysLoginService extends BaseService {
    */
   async captcha(type: string, width = 150, height = 50) {
     const svg = svgCaptcha.create({
+      // ignoreChars: 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM',
       ignoreChars: 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM',
       width,
       height,

+ 0 - 23
cool-admin-midway-master/src/app/modules/hide/config.ts

@@ -1,23 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:21:24
- * @LastEditTime: 2022-04-24 13:56:58
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\config.ts
- */
-import { Application } from 'egg';
-import { ModuleConfig } from 'midwayjs-cool-core';
-
-/**
- * 
- */
-export default (app: Application) => {
-  return {
-    // 模块名称
-    name: 'hide',
-    // 模块描述
-    description: '隐藏任务模块,用于测试拉号接口',
-    // 中间件
-    middlewares: [],
-  } as ModuleConfig;
-};

+ 0 - 51
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_account_type.ts

@@ -1,51 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:57:53
- * @LastEditTime: 2022-04-21 17:10:19
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_account_type.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { HideAccountTypeEntity } from '../../entity/hide_account_type';
-
-/**
- * 游戏负责人
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideAccountTypeEntity,
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.name == "") {
-      data.name = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['name'],
-    // 让字段支持筛选
-    fieldEq: ['name'],
-    // 添加排序
-    addOrderBy: {
-      // 排序字段及排序方式
-      name: 'desc',
-    },
-  },
-})
-export class HideAccountTypeController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 232
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_account.ts

@@ -1,232 +0,0 @@
-import { Inject, Post, Provide, ALL, Body } from '@midwayjs/decorator';
-// import { Context } from 'egg';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { HideGameAccountEntity } from '../../entity/hide_game_account';
-import * as _ from 'lodash';
-import { ILogger } from '@midwayjs/logger';
-import { HideGameAccountService } from '../../service/hide_game_account';
-import { HideGameAccountTempService } from '../../service/hide_game_account_temp';
-// import { HideIdCardUsageEntity } from '../../entity/idcard_usage';
-const fs = require('fs')
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameAccountEntity,
-  service: HideGameAccountService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.id_name == "") {
-      data.id_name = null
-    }
-    if (data.id_number == "") {
-      data.id_number = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['account_text', 'password_text'],
-    // 让字段支持筛选
-    fieldEq: ['account_text', 'password_text'],
-    //   // 指定返回字段
-    //   select: ['a.*', 'b.name'],
-    //   // 关联表用户表
-    // leftJoin: [
-    //   {
-    //     // 管理的表
-    //     entity: HideIdCardUsageEntity,
-    //     // 别名
-    //     alias: 'b',
-    //     // 关联条件
-    //     condition: 'a.userId = b.id',
-    //   },
-    // ],
-    //   // 增加其他条件
-    //   where: async (ctx: Context) => {
-    //     return [
-    //       // 价格大于90
-    //       ['a.price > :price', { price: 90.0 }],
-    //     ];
-    //   },
-    //   // 添加排序
-    addOrderBy: {
-      // 排序字段及排序方式
-      id: 'desc',
-    },
-  },
-})
-export class HideAdminGameAccountController extends BaseController {
-
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  HideGameAccountService: HideGameAccountService;
-
-  @Inject()
-  HideGameAccountTempService: HideGameAccountTempService;
-
-  /**
-   *批量插入数据库
-   */
-  @Post('/batchAdd')
-  async batchAdd(@Body(ALL) queryObject) {
-
-    const { fileaddress, type_id, status, remark } = queryObject;
-    const filename = fileaddress._value.split("uploads")[1]
-    // console.log(filename)
-    let reqmsg
-    // 定义读取文件函数
-    var readFile = function (fileName) {
-      return new Promise(function (resolve, reject) {
-        fs.readFile(fileName, function (error, data) {
-          if (error) return reject(error);
-          var chrom = "";
-          let idcardArr = [];
-          chrom = data.toString();
-          const accounts = chrom.split(/[\r\n]+/);//按照换行符分割成数组
-          accounts.forEach((item, index) => {
-            if (item) {
-              var data1 = item.split('----')
-              if (data1.length < 2) {
-                console.log(index + "文件格式错误")
-                resolve({ code: -1, message: index + '文件格式错误' })
-              }
-              let obj = {
-                account_text: data1[0],
-                password_text: data1[1],
-                vpn_text: data1[2],
-                manufacturer: data1[3],
-                model: data1[4],
-                pnumber: data1[5],
-                imei: data1[6],
-                imsi: data1[7],
-                simserial: data1[8],
-                androidid: data1[9],
-                mac: data1[10],
-                type_id: type_id,
-                status: status,
-                remark: remark
-              }
-              idcardArr.push(obj)
-            }
-          })
-          resolve({ code: 1, data: idcardArr });
-        });
-      });
-    };
-    let composeText
-    composeText = await readFile("public/uploads" + filename);
-    if (composeText.code == -1) {
-      return this.ok({ code: -1, message: '文件格式错误' });
-    }
-    //======================================================插入临时表开始======================================================
-    // 将文件拆分为1万一个,一次上传1万条,防止数据库报错
-    let idcard_text_temp
-    await ykhForeach(composeText.data, async (item, index) => {
-      if (index % 10000 == 0) {
-        if (index != 0) {
-          await this.HideGameAccountTempService.batchAdd(idcard_text_temp);
-        }
-        idcard_text_temp = `('` + item.account_text + `',` + `'` + item.password_text + `',` + `'` + item.remark + `')`
-      } else {
-        idcard_text_temp += `,('` + item.account_text + `',` + `'` + item.password_text + `',` + `'` + item.remark + `')`
-        if (index == composeText.data.length - 1) {
-          await this.HideGameAccountTempService.batchAdd(idcard_text_temp);
-        }
-      }
-
-    });
-    //======================================================插入临时表结束======================================================
-    //对比临时表和账号表,找出账号表中已存在的数据
-    let repeat = await this.HideGameAccountTempService.contrastData(type_id);
-    this.logger.info(repeat.length)
-    //清空临时表数据
-    await this.HideGameAccountTempService.deleteAll();
-    // 将文件拆分为1万一个,一次上传1万条,防止数据库报错
-    let idcard_text
-    let sumaccAll = 0
-    let duplicatesAll = 0
-    let affectedRowsAll = 0
-    await ykhForeach(composeText.data, async (item, index) => {
-      if (index % 10000 == 0) {
-        if (index != 0) {
-          reqmsg = await this.HideGameAccountService.batchAdd(idcard_text);
-          // this.logger.info(reqmsg)
-          let str = reqmsg.message.toString();
-          let duplicates;
-          duplicates = str.substring(str.indexOf('Duplicates') + 12, str.indexOf('Warnings') - 1);
-          // let sumacc = parseInt(reqmsg.warningCount + reqmsg.affectedRows) - parseInt(reqmsg.changedRows);
-          // sumaccAll += sumacc;
-          duplicatesAll += parseInt(duplicates);
-          affectedRowsAll += parseInt(reqmsg.affectedRows);
-        }
-        idcard_text = `('` + item.account_text + `',` + `'` + item.password_text + `',` + `'` + item.vpn_text + `',` + `'` + item.manufacturer
-          + `',` + `'` + item.model + `',` + `'` + item.pnumber + `',` + `'` + item.imei + `',` + `'` + item.imsi + `',` + `'` + item.simserial
-          + `',` + `'` + item.androidid + `',` + `'` + item.mac + `',` + `'` + item.type_id + `',` + `'` + item.status + `',` + `'` + item.remark + `')`
-      } else {
-        idcard_text += `,('` + item.account_text + `',` + `'` + item.password_text + `',` + `'` + item.vpn_text + `',` + `'` + item.manufacturer
-          + `',` + `'` + item.model + `',` + `'` + item.pnumber + `',` + `'` + item.imei + `',` + `'` + item.imsi + `',` + `'` + item.simserial
-          + `',` + `'` + item.androidid + `',` + `'` + item.mac + `',` + `'` + item.type_id + `',` + `'` + item.status + `',` + `'` + item.remark + `')`
-        if (index == composeText.data.length - 1) {
-          reqmsg = await this.HideGameAccountService.batchAdd(idcard_text);
-          // this.logger.info(reqmsg)
-          let str = reqmsg.message.toString();
-          let duplicates;
-          duplicates = str.substring(str.indexOf('Duplicates') + 12, str.indexOf('Warnings') - 1);
-          // let sumacc = parseInt(reqmsg.warningCount + reqmsg.affectedRows) - parseInt(reqmsg.changedRows);
-          // sumaccAll += sumacc;
-          duplicatesAll += parseInt(duplicates);
-          affectedRowsAll += parseInt(reqmsg.affectedRows);
-        }
-      }
-    });
-    //删除上传的txt
-    //================
-    if (fs.existsSync("public/uploads" + filename)) {
-      fs.unlinkSync("public/uploads" + filename);
-    }
-    //================
-    sumaccAll = duplicatesAll + affectedRowsAll
-    return this.ok({ code: 1, repeat: repeat, duplicatesAll: duplicatesAll, message: '本次上传账号共计' + sumaccAll + '条, 成功上传' + affectedRowsAll + '条, 重复数据' + duplicatesAll + '条' });
-
-  }
-
-
-
-
-
-}
-
-// foreach加上async/await
-const ykhForeach = async (arr, callback) => {
-  const length = arr.length;
-  const O = Object(arr);
-  let k = 0;
-  while (k < length) {
-    if (k in O) {
-      // console.log('doing foreach...');
-      const kValue = O[k];
-      await callback(kValue, k, O);
-    }
-    k++;
-  }
-};
-

+ 0 - 81
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_agent.ts

@@ -1,81 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:57:53
- * @LastEditTime: 2022-04-21 17:10:01
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_game_agent.ts
- */
-import { Provide } from '@midwayjs/decorator';
-// import { Context } from 'egg';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { HideGameAgentEntity } from '../../entity/hide_game_agent';
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameAgentEntity,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.name == "") {
-      data.name = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['name'],
-    // 让字段支持筛选
-    fieldEq: ['name']
-    //   // 指定返回字段
-    //   select: ['a.*', 'b.name'],
-    //   // 关联表用户表
-    //   leftJoin: [
-    //     {
-    //       // 管理的表
-    //       entity: BaseSysUserEntity,
-    //       // 别名
-    //       alias: 'b',
-    //       // 关联条件
-    //       condition: 'a.userId = b.id',
-    //     },
-    //   ],
-    //   // 增加其他条件
-    //   where: async (ctx: Context) => {
-    //     return [
-    //       // 价格大于90
-    //       ['a.price > :price', { price: 90.0 }],
-    //     ];
-    //   },
-    //   // 添加排序
-    //   addOrderBy: {
-    //     // 排序字段及排序方式
-    //     price: 'desc',
-    //   },
-  },
-})
-export class HideGameAgentController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 54
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_director.ts

@@ -1,54 +0,0 @@
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { HideGameDirectorEntity } from '../../entity/hide_game_director';
-import { HideGameDirectorService } from '../../service/hide_game_director';
-
-/**
- * 游戏负责人
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameDirectorEntity,
-  service: HideGameDirectorService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.name == "") {
-      data.name = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['name'],
-    // 让字段支持筛选
-    fieldEq: ['name'],
-    // 添加排序
-    addOrderBy: {
-      // 排序字段及排序方式
-      name: 'desc',
-    },
-  },
-})
-export class HideGameDirectorController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 58
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_list.ts

@@ -1,58 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-23 15:45:46
- * @LastEditTime: 2022-04-21 17:09:45
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_game_list.ts
- */
-import { Provide } from '@midwayjs/decorator';
-// import { Context } from 'egg';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { HideGameListEntity } from '../../entity/hide_game_list';
-import { HideGameListService } from '../../service/hide_game_list';
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameListEntity,
-  service: HideGameListService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.game_name == "") {
-      data.game_name = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['game_name', 'game_agent', 'login_mode'],
-    // 让字段支持筛选
-    fieldEq: ['game_name', 'game_agent', 'login_mode']
-  },
-})
-export class HideAdminGameListController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 65
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_target.ts

@@ -1,65 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:09:39
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_game_target.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { HideGameTargetEntity } from '../../entity/hide_game_target';
-import { HideGameTargetService } from '../../service/hide_game_target';
-
-/**
- * 游戏目标
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameTargetEntity,
-  service: HideGameTargetService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (typeof (data.new_date) == "undefined") {
-      data.new_date = [new Date(), new Date()]
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['id'],
-    // 让字段支持筛选
-    fieldEq: ['id'],
-    // 添加排序
-    addOrderBy: {
-      // 排序字段及排序方式
-      directorName: 'asc',
-    },
-  },
-})
-export class HideGameTargetController extends BaseController {
-
-  // @Inject()
-  // HideGameTaskService: HideGameTaskService;
-
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 149
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_task.ts

@@ -1,149 +0,0 @@
-import { Provide, Post, Inject, Body, ALL } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { HideGameTaskEntity } from '../../entity/hide_game_task';
-import { HideGameTaskService } from '../../service/hide_game_task';
-import { ILogger } from '@midwayjs/logger';
-import { HideGameTargetService } from '../../service/hide_game_target';
-import { HideGameCompleteService } from '../../service/hide_game_complete';
-import { Utils } from '../../../../comm/utils';
-import { HideGameAgentService } from '../../service/hide_game_agent';
-import { HideLoModeService } from '../../service/hide_lo_mode';
-import { HideGameDirectorService } from '../../service/hide_game_director';
-// import * as qiNiu from 'qiniu';
-/**
- * 游戏负责人
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideGameTaskEntity,
-  service: HideGameTaskService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['id'],
-    // 让字段支持筛选
-    fieldEq: ['id'],
-    // 添加排序
-    addOrderBy: {
-      // 排序字段及排序方式
-      id: 'asc',
-    },
-  },
-})
-export class HideAdminGameTaskController extends BaseController {
-
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  HideGameTaskService: HideGameTaskService;
-
-  @Inject()
-  HideGameTargetService: HideGameTargetService;
-
-  @Inject()
-  HideGameCompleteService: HideGameCompleteService;
-
-  @Inject()
-  HideGameAgentService: HideGameAgentService;
-
-  @Inject()
-  HideLoModeService: HideLoModeService;
-
-  @Inject()
-  HideGameDirectorService: HideGameDirectorService;
-
-  @Inject()
-  utils: Utils;
-  /**
-   *
-   * 停止任务
-   * @param {object} queryObject
-   * @return {*} 
-   * @memberof HideGameTaskController
-   */
-  @Post('/stopTask')
-  async stopTask(@Body(ALL) queryObject) {
-    // this.logger.info(queryObject)
-    let { id, stopTime, stopRemark, game_agentId, login_modeId, directorId } = queryObject
-    let reqmsg = await this.HideGameTaskService.stopTask(id, stopTime, stopRemark);
-    //把stopTime的game_target表里的目标改为0,删掉之后的目标
-    stopTime = this.utils.formatDate(stopTime)
-    await this.HideGameTargetService.updateTarget(id, stopTime);
-    // this.logger.warn(reqtarget)
-    // 端口对应的游戏数量-1
-    // this.logger.warn(game_agentId)
-    await this.HideGameAgentService.reduceGameNumByname(game_agentId)
-    // 登录方式对应游戏数量-1
-    await this.HideLoModeService.reduceGameNumByname(login_modeId)
-    // 对应负责人的游戏数量-1
-    await this.HideGameDirectorService.reduceGameNumById(directorId)
-    // this.logger.warn(returnMsg)
-    //
-    if (reqmsg == 1000) {
-      return await this.ok({ code: 1, message: '任务已停止' });
-    } else {
-      return await this.fail('任务异常', -1);
-    }
-  }
-
-  @Post('/startTask')
-  async startTask(@Body(ALL) queryObject: HideGameTaskEntity) {
-    // this.logger.info(queryObject)
-    let { id, game_agentId, login_modeId, directorId } = queryObject
-    let reqmsg = await this.HideGameTaskService.startTask(id);
-    //添加任务目标
-    await this.HideGameTargetService.addTarget(queryObject);
-    await this.HideGameCompleteService.addComplete(queryObject);
-    // 端口对应的游戏数量+1
-    await this.HideGameAgentService.addGameNumByname(game_agentId)
-    // 登录方式对应游戏数量+1
-    await this.HideLoModeService.addGameNumByname(login_modeId)
-    // 对应负责人的游戏数量+1
-    await this.HideGameDirectorService.addGameNumById(directorId)
-    // this.logger.info(returnMsg)
-    if (reqmsg == 1000) {
-      return await this.ok({ code: 1, message: '任务已开启' });
-    } else {
-      return await this.fail('任务异常', -1);
-    }
-  }
-
-  /**
-   *根据任务id删除任务
-   *
-   * @param {*} queryObject
-   * @return {*} 
-   * @memberof HideAdminGameTaskController
-   */
-  @Post('/deleteById')
-  async deleteById(@Body(ALL) queryObject) {
-    // this.logger.info(queryObject)
-    let { id } = queryObject
-    // console.log(id)
-    let reqmsg = await this.HideGameTaskService.deleteById(id);
-    if (reqmsg == 1000) {
-      return await this.ok({ code: 1, message: '任务删除成功' });
-    } else {
-      return await this.fail('任务删除失败', -1);
-    }
-  }
-
-}

+ 0 - 79
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_lo_mode.ts

@@ -1,79 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:08:58
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_lo_mode.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { HideLoModeEntity } from '../../entity/hide_lo_mode';
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: HideLoModeEntity,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.name == "") {
-      data.name = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['name'],
-    // 让字段支持筛选
-    fieldEq: ['name']
-    //   // 指定返回字段
-    //   select: ['a.*', 'b.name'],
-    //   // 关联表用户表
-    //   leftJoin: [
-    //     {
-    //       // 管理的表
-    //       entity: BaseSysUserEntity,
-    //       // 别名
-    //       alias: 'b',
-    //       // 关联条件
-    //       condition: 'a.userId = b.id',
-    //     },
-    //   ],
-    //   // 增加其他条件
-    //   where: async (ctx: Context) => {
-    //     return [
-    //       // 价格大于90
-    //       ['a.price > :price', { price: 90.0 }],
-    //     ];
-    //   },
-    //   // 添加排序
-    //   addOrderBy: {
-    //     // 排序字段及排序方式
-    //     price: 'desc',
-    //   },
-  },
-})
-export class HideAdminLoModeController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 265
cool-admin-midway-master/src/app/modules/hide/controller/app/game_task.ts

@@ -1,265 +0,0 @@
-import { Get, Inject, Provide, Query, ALL } from '@midwayjs/decorator';
-import { ILogger } from '@midwayjs/logger';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { HideGameTaskEntity } from '../../entity/hide_game_task';
-import { HideGameTaskService } from '../../service/hide_game_task';
-import * as _ from 'lodash';
-import { Utils } from '../../../../comm/utils';
-import { HideGameAccountService } from '../../service/hide_game_account';
-import { HideTaskAccountRecordEntity } from '../../entity/hide_task_account_record';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import { HideGameAccountRecordEntity } from '../../entity/hide_game_account_record';
-import { HideTaskAccountRecordService } from '../../service/hide_task_account_record';
-import { HideGameTargetService } from '../../service/hide_game_target';
-
-
-/**
- * 任务接口
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'update', 'info'],
-  // 设置表实体
-  entity: HideGameTaskEntity,
-  service: HideGameTaskService,
-
-})
-export class HideAppGameTaskController extends BaseController {
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  HideGameTaskService: HideGameTaskService;
-  @Inject()
-  HideGameTargetService: HideGameTargetService;
-  @Inject()
-  HideTaskAccountRecordService: HideTaskAccountRecordService;
-  @Inject()
-  utils: Utils;
-
-  @Inject()
-  HideGameAccountService: HideGameAccountService;
-
-  @InjectEntityModel(HideTaskAccountRecordEntity)
-  HideTaskAccountRecordEntity: Repository<HideTaskAccountRecordEntity>;
-
-  @InjectEntityModel(HideGameAccountRecordEntity)
-  HideGameAccountRecordEntity: Repository<HideGameAccountRecordEntity>;
-
-  /**
-   * http://127.0.0.1:8001/app/hide/game_task/getTaskTAndC?task_id=1001&new_date=2022-04-24
-   * //获取游戏目标与完成{task_id,new_date}
-   * @param {*} queryObject
-   * @memberof HideAppGameTaskController
-   */
-  //
-  @Get('/getTaskTAndC')
-  async getTaskTAndC(@Query(ALL) queryObject) {
-    let { task_id, new_date } = queryObject
-    if (!new_date) {
-      new_date = this.utils.formatDate(new Date(new_date))
-    }
-    let queryObj
-    if (task_id && task_id != '') {
-      const taskInfo = await this.HideGameTaskService.info(task_id);
-      if (!taskInfo) {
-        return this.fail('task_id不存在', -1)
-      }
-      if (taskInfo.is_run == 0) {
-        return this.fail('该任务未运行', -1)
-      }
-      queryObj = {
-        task_id: task_id,
-        new_date: new_date
-      }
-    } else {
-      queryObj = {
-        new_date: new_date
-      }
-    }
-    const list = await this.HideGameTargetService.getTaskTAndC(queryObj);
-    // this.logger.info(list)
-    if (list.length > 0) {
-      let resT = []
-      list.forEach(e => {
-        //
-        let obj = {
-          task_id: e.task_id,
-          task_name: e.task_name,
-          game_director: e.directorName,
-          login_mode: e.login_mode,
-          game_agent: e.game_agent,
-          target_new: parseInt(e.target_new),
-          target_pay: parseInt(e.target_pay),
-          target_active: parseInt(e.target_active),
-          complete_new: parseInt(e.complete_new),
-          complete_pay: parseInt(e.complete_pay),
-          complete_active: parseInt(e.complete_active),
-          is_complete: e.is_complete,  //是否完成
-          amount: e.amount,   //付费流水
-          incomplete_new: parseInt(e.incomplete_new),
-          incomplete_pay: parseInt(e.incomplete_pay),
-          incomplete_active: parseInt(e.incomplete_active)
-        }
-
-        resT.push(obj)
-      });
-
-      return { code: 1000, message: '获取游戏数据成功', date: new_date, data: resT };
-    } else {
-      return this.fail('任务' + task_id + '获取失败', -1);
-    }
-  }
-
-  /**
-   * http://127.0.0.1:8001/app/shuyou/game_task/get_account?task_id=3520&status=0
-   * 拉取任务账号-新增账号{status 0.正常 1.冻结 2.密错 5.人脸验证  6.信用分不足}
-   * @param {*} queryObject
-   * @return {*} 
-   * @memberof HideAppGameTaskController
-   */
-  @Get('/get_account')
-  async getAccount(@Query(ALL) queryObject) {
-    let { task_id, status } = queryObject
-    if (!task_id) {
-      return this.fail('缺少必要参数[task_id=任务id]', -1)
-    }
-    const taskInfo = await this.HideGameTaskService.info(task_id);
-    if (!taskInfo) {
-      return this.fail('task_id不存在', -1)
-    }
-    let account_state = 0
-    if (!status) {
-      account_state = 0;
-    } else {
-      account_state = status;
-    }
-    const account_typeId = taskInfo.account_typeId
-    const gameIdList = taskInfo.gameIdList
-    const list = await this.HideGameTaskService.getAccountOne(task_id, account_typeId, account_state);
-    // this.logger.info(list)
-    if (list.length > 0) {
-      const account_id = list[0].id
-      await this.HideGameAccountService.updateOccupy(account_id, task_id);
-      const inserTaskAccountRecord = await this.HideTaskAccountRecordEntity.createQueryBuilder()
-        .insert()
-        .into(HideTaskAccountRecordEntity)
-        .values({
-          task_id: task_id,
-          account_id: account_id,
-          new_date: new Date(this.utils.formatDate(new Date())),
-          getTimeNew: new Date()  // 新增取号时间
-        })
-        .execute();
-      if (!inserTaskAccountRecord) {
-        return this.fail('插入记录表失败', -1)
-      }
-      // this.logger.info(inserTaskAccountRecord.identifiers[0].id)
-      for (const game_id of gameIdList) {
-        await this.HideGameAccountRecordEntity.save({ account_id: account_id + '', game_id: game_id + '' });
-      }
-      let obj = {
-        record_id: inserTaskAccountRecord.identifiers[0].id,
-        account_text: list[0].account_text,
-        password_text: list[0].password_text,
-        vpn_text: list[0].vpn_text,
-        manufacturer: list[0].manufacturer,
-        model: list[0].model,
-        pnumber: list[0].pnumber,
-        imei: list[0].imei,
-        imsi: list[0].imsi,
-        simserial: list[0].simserial,
-        androidid: list[0].androidid,
-        mac: list[0].mac
-      }
-      return this.ok(obj);
-    } else {
-      return this.fail('任务' + task_id + '无账号可取', -1);
-    }
-  }
-  /**
-   * 留存获取账号接口
-   * http://127.0.0.1:8001/app/shuyou/game_task/get_account_retained?task_id=3520&retained_day=2
-   * @param {*} queryObject{task_id:任务id,retained_day:留存天数}
-   * @return {*} 
-   * @memberof HideAppGameTaskController
-   */
-  @Get('/get_account_retained')
-  async getAccountRetained(@Query(ALL) queryObject) {
-    let { task_id, retained_day } = queryObject
-    if (!task_id || !retained_day) {
-      return this.fail('缺少必要参数[task_id=任务id&retained_day=几留]', -1)
-    }
-    const taskInfo = await this.HideGameTaskService.info(task_id);
-    if (!taskInfo) {
-      return this.fail('task_id不存在', -1)
-    }
-    let retained_date = this.utils.getNextDate(new Date, 1 - retained_day)
-    // this.logger.info(retained_date)
-    const list = await this.HideGameTaskService.getAccountRetainedOne(task_id, retained_date);
-    // this.logger.info(list)
-    if (list.length > 0) {
-      const record_id = list[0].id
-      const updateTaskAccountRecord = await this.HideTaskAccountRecordEntity
-        .createQueryBuilder()
-        .update()
-        .set({
-          statusRetained: -1,
-          getTimeRetained: new Date()  // 留存取号时间
-        })
-        .where('id = :id', {
-          id: record_id
-        })
-        .execute();
-      // this.logger.warn(updateTaskAccountRecord.affected)
-      if (updateTaskAccountRecord.affected < 1) {
-        return this.fail('修改记录表失败', -1)
-      }
-      let obj = {
-        record_id: record_id,
-        account_text: list[0].account_text,
-        password_text: list[0].password_text,
-        vpn_text: list[0].vpn_text,
-        manufacturer: list[0].manufacturer,
-        model: list[0].model,
-        pnumber: list[0].pnumber,
-        imei: list[0].imei,
-        imsi: list[0].imsi,
-        simserial: list[0].simserial,
-        androidid: list[0].androidid,
-        mac: list[0].mac
-      }
-      return this.ok(obj);
-    } else {
-      return this.fail('任务' + task_id + ' ' + retained_day + '留已无可取账号', -1);
-    }
-  }
-
-
-  /**
-   * 更新账号状态
-   * http://127.0.0.1:8001/app/shuyou/game_task/updateAccount?record_id=10&status=0
-   * status 0.新增留存成功 1.冻结 2.密错 3.禁用 4.新增出现留存 5.人脸验证  6.信用分不足
-   * @param {*} queryObject
-   * @return {*} 
-   * @memberof HideAppGameTaskController
-   */
-  @Get('/updateAccount')
-  async updateAccount(@Query(ALL) queryObject) {
-    const { record_id, status } = queryObject
-    // status 0.新增留存成功 1.冻结 2.密错 3.禁用 4.新增出现留存 5.人脸验证
-    const TaskAccountRecord = await this.HideTaskAccountRecordService.updateAccount(record_id, status);
-    if (TaskAccountRecord.code == 1) {
-      await this.HideGameAccountService.updateAccountState(TaskAccountRecord.account_id, status);
-      return this.ok('修改成功');
-    } else if (TaskAccountRecord.code == 2) {
-      return this.fail(TaskAccountRecord.message, 2);
-    } else {
-      return this.fail('修改失败', -1);
-    }
-
-  }
-
-}

+ 0 - 25
cool-admin-midway-master/src/app/modules/hide/entity/hide_account_type.ts

@@ -1,25 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:34:31
- * @LastEditTime: 2022-04-21 16:34:48
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\account_type.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, PrimaryColumn } from 'typeorm';
-
-/**
- * 账号类型
- */
-@EntityModel('hide_account_type')
-export class HideAccountTypeEntity extends BaseEntity {
-
-  @PrimaryColumn({ comment: '类型名称', length: 100 })
-  name: string;
-
-  @Column({ comment: '描述', nullable: true, length: 200 })
-  description: string;
-
-}
-

+ 0 - 75
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account.ts

@@ -1,75 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-21 18:23:13
- * @LastEditTime: 2022-04-21 16:37:28
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_account.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 游戏账号表
- */
-@EntityModel('hide_game_account')
-@Index(["account_text", "type_id"], { unique: true }) // 联合索引
-export class HideGameAccountEntity extends BaseEntity {
-
-  @Column({ comment: '账号', length: 50 })
-  account_text: string;
-
-  @Column({ comment: '密码', length: 50 })
-  password_text: string;
-
-  @Column({ comment: 'vpn域', nullable: true, length: 50 })
-  vpn_text: string;
-
-  @Column({ comment: '厂商', nullable: true, length: 50 })
-  manufacturer: string;
-
-  @Column({ comment: '型号', nullable: true, length: 50 })
-  model: string;
-
-  @Column({ comment: '手机号码', nullable: true, length: 50 })
-  pnumber: string;
-
-  @Column({ comment: 'imei', nullable: true, length: 50 })
-  imei: string;
-
-  @Column({ comment: 'imsi', nullable: true, length: 50 })
-  imsi: string;
-
-  @Column({ comment: '序列号', nullable: true, length: 50 })
-  simserial: string;
-
-  @Column({ comment: '安卓id', nullable: true, length: 50 })
-  androidid: string;
-
-  @Column({ comment: 'mac地址', nullable: true, length: 50 })
-  mac: string;
-
-  @Index()
-  @Column({ comment: '账号类型id' })
-  type_id: string;
-
-  @Column({ comment: '账号所处状态 0.正常 1.冻结 2.密错 3.禁用 5.人脸验证 6.信用分不足', default: 0, type: 'tinyint' })
-  status: number;
-
-  @Column({ comment: '冻结密错日期', nullable: true })
-  frozenTime: Date;
-
-  @Column({ comment: '被取走时间', nullable: true })
-  getTime: Date;
-
-  @Index()
-  @Column({ comment: '当前占用任务ID', default: 0 })
-  occupy_taskId: string;
-
-  @Column({ comment: '释放时间', nullable: true })
-  releaseTime: Date;
-
-  @Column({ comment: '备注', nullable: true })
-  remark: string;
-
-}

+ 0 - 27
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account_record.ts

@@ -1,27 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-23 15:35:47
- * @LastEditTime: 2022-04-21 16:35:24
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_account_record.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 游戏-账号对应表
- */
-@EntityModel('hide_game_account_record')
-export class HideGameAccountRecordEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '账号id', length: 100 })
-  account_id: string;
-
-  @Index()
-  @Column({ comment: '游戏id', length: 100 })
-  game_id: string;
-
-
-}

+ 0 - 27
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_account_temp.ts

@@ -1,27 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-21 18:23:13
- * @LastEditTime: 2022-04-21 16:37:14
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_account_temp.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 临时账号表
- */
-@EntityModel('hide_game_account_temp')
-export class HideGameAccountTempEntity extends BaseEntity {
-
-  @Column({ comment: '账号', length: 50 })
-  account_text: string;
-
-  @Column({ comment: '密码', length: 50 })
-  password_text: string;
-
-  @Column({ comment: '备注', nullable: true })
-  remark: string;
-
-}

+ 0 - 30
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_agent.ts

@@ -1,30 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 16:37:38
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_agent.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 游戏厂商
- */
-@EntityModel('hide_game_agent')
-export class HideGameAgentEntity extends BaseEntity {
-  @Column({ comment: '厂商名称' })
-  name: string;
-
-  @Column({ comment: '描述' })
-  description: string;
-
-  @Column({ comment: '显示顺序', nullable: true })
-  sort: number;
-
-  @Column({ comment: '该厂商类别下游戏数量', default: 0 })
-  game_count: number;
-
-}
-

+ 0 - 134
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_complete.ts

@@ -1,134 +0,0 @@
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 每日游戏完成表
- */
-@EntityModel('hide_game_complete')
-@Index(["task_id", "new_date"], { unique: true }) // 联合索引
-export class HideGameCompleteEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '任务id' })
-  task_id: string;
-
-  @Index()
-  @Column({ comment: '任务名', length: 100 })
-  task_name: string;
-
-  @Index()
-  @Column({ type: 'date', comment: '完成日期' })
-  new_date: Date;
-
-  @Column({ comment: '完成新增', default: 0 })
-  complete_new: number;
-
-  @Column({ comment: '完成付费', default: 0 })
-  complete_pay: number;
-
-  @Column({ comment: '完成活跃(所有留存完成的和+新增完成)', default: 0 })
-  complete_active: number;
-
-  @Column({ comment: '付费流水', type: 'decimal', default: 0.00, scale: 2 })
-  amount: number;
-
-  @Column({ comment: '是否完成目标 0:否 1:是', default: 0, type: 'tinyint' })
-  is_complete: number;
-
-  @Column({ comment: '群控效率(新增/留存/付费)', default: '0/0/0' })
-  game_rate: string;
-
-  @Column({ comment: '小绵羊效率(新增/留存/付费)', default: '0/0/0' })
-  game_rate_xmy: string;
-
-  @Column({ comment: '完成次留', default: 0 })
-  complete_two: number;
-
-  @Column({ comment: '完成3留', default: 0 })
-  complete_three: number;
-
-  @Column({ comment: '完成4留', default: 0 })
-  complete_four: number;
-
-  @Column({ comment: '完成5留', default: 0 })
-  complete_five: number;
-
-  @Column({ comment: '完成6留', default: 0 })
-  complete_six: number;
-
-  @Column({ comment: '完成7留', default: 0 })
-  complete_seven: number;
-
-  @Column({ comment: '完成8留', default: 0 })
-  complete_eight: number;
-
-  @Column({ comment: '完成9留', default: 0 })
-  complete_nine: number;
-
-  @Column({ comment: '完成10留', default: 0 })
-  complete_ten: number;
-
-  @Column({ comment: '完成11留', default: 0 })
-  complete_eleven: number;
-
-  @Column({ comment: '完成12留', default: 0 })
-  complete_twelve: number;
-
-  @Column({ comment: '完成13留', default: 0 })
-  complete_thirteen: number;
-
-  @Column({ comment: '完成14留', default: 0 })
-  complete_fourteen: number;
-
-  @Column({ comment: '完成15留', default: 0 })
-  complete_fifteen: number;
-
-  @Column({ comment: '完成16留', default: 0 })
-  complete_sixteen: number;
-
-  @Column({ comment: '完成17留', default: 0 })
-  complete_seventeen: number;
-
-  @Column({ comment: '完成18留', default: 0 })
-  complete_eighteen: number;
-
-  @Column({ comment: '完成19留', default: 0 })
-  complete_nineteen: number;
-
-  @Column({ comment: '完成20留', default: 0 })
-  complete_twenty: number;
-
-  @Column({ comment: '完成21留', default: 0 })
-  complete_twentyone: number;
-
-  @Column({ comment: '完成22留', default: 0 })
-  complete_twentytwo: number;
-
-  @Column({ comment: '完成23留', default: 0 })
-  complete_twentythree: number;
-
-  @Column({ comment: '完成24留', default: 0 })
-  complete_twentyfour: number;
-
-  @Column({ comment: '完成25留', default: 0 })
-  complete_twentyfive: number;
-
-  @Column({ comment: '完成26留', default: 0 })
-  complete_twentysix: number;
-
-  @Column({ comment: '完成27留', default: 0 })
-  complete_twentyseven: number;
-
-  @Column({ comment: '完成28留', default: 0 })
-  complete_twentyeight: number;
-
-  @Column({ comment: '完成29留', default: 0 })
-  complete_twentynine: number;
-
-  @Column({ comment: '完成30留', default: 0 })
-  complete_thirty: number;
-
-
-
-}

+ 0 - 46
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_director.ts

@@ -1,46 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 16:38:06
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_director.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 游戏负责人
- */
-@EntityModel('hide_game_director')
-export class HideGameDirectorEntity extends BaseEntity {
-
-
-  @Column({ comment: '姓名', length: 100 })
-  name: string;
-
-  @Column({ comment: '昵称', nullable: true })
-  nickName: string;
-
-  @Column({ comment: '头像', nullable: true })
-  headImg: string;
-
-  @Column({ comment: '手机', nullable: true, length: 20 })
-  phone: string;
-
-  @Column({ comment: '邮箱', nullable: true })
-  email: string;
-
-  @Column({ comment: '备注', nullable: true })
-  remark: string;
-
-  @Column({ comment: '状态 0:禁用 1:启用', default: 1, type: 'tinyint' })
-  status: number;
-
-  @Column({ comment: '所属部门', nullable: true })
-  departmentName: string;
-
-  @Column({ comment: '负责的游戏数量', default: 0 })
-  game_count: number;
-
-}

+ 0 - 32
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_list.ts

@@ -1,32 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-23 15:35:47
- * @LastEditTime: 2022-04-21 16:38:20
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\game_list.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 游戏列表
- */
-
-@EntityModel('hide_game_list')
-export class HideGameListEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '游戏名称', length: 100 })
-  game_name: string;
-
-  @Column({ comment: '游戏端口id' })
-  game_agentId: number;
-
-  @Column({ comment: '登录方式id' })
-  login_modeId: number;
-
-  @Column({ comment: '备注', nullable: true })
-  remark: string;
-
-}

+ 0 - 134
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_target.ts

@@ -1,134 +0,0 @@
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 每日游戏目标表
- */
-@EntityModel('hide_game_target')
-@Index(["task_id", "new_date"], { unique: true }) // 联合索引
-export class HideGameTargetEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '任务id' })
-  task_id: string;
-
-  @Index()
-  @Column({ comment: '任务名', length: 100 })
-  task_name: string;
-
-  @Column({ comment: '负责人id' })
-  directorId: number;
-
-  @Index()
-  @Column({ type: 'date', comment: '目标日期' })
-  new_date: Date;
-
-  @Column({ comment: '目标新增', default: 0 })
-  target_new: number;
-
-  @Column({ comment: '目标付费', default: 0 })
-  target_pay: number;
-
-  @Column({ comment: '目标活跃(所有留存目标的和+新增目标)', default: 0 })
-  target_active: number;
-
-  @Column({ comment: '新增下限', default: 0 })
-  target_new_low: number;
-
-  @Column({ comment: '付费下限', default: 0 })
-  target_pay_low: number;
-
-  @Column({ comment: '活跃下限', default: 0 })
-  target_active_low: number;
-
-  @Column({ comment: '目标次留', default: 0 })
-  lc_two: number;
-
-  @Column({ comment: '目标3留', default: 0 })
-  lc_three: number;
-
-  @Column({ comment: '目标4留', default: 0 })
-  lc_four: number;
-
-  @Column({ comment: '目标5留', default: 0 })
-  lc_five: number;
-
-  @Column({ comment: '目标6留', default: 0 })
-  lc_six: number;
-
-  @Column({ comment: '目标7留', default: 0 })
-  lc_seven: number;
-
-  @Column({ comment: '目标8留', default: 0 })
-  lc_eight: number;
-
-  @Column({ comment: '目标9留', default: 0 })
-  lc_nine: number;
-
-  @Column({ comment: '目标10留', default: 0 })
-  lc_ten: number;
-
-  @Column({ comment: '目标11留', default: 0 })
-  lc_eleven: number;
-
-  @Column({ comment: '目标12留', default: 0 })
-  lc_twelve: number;
-
-  @Column({ comment: '目标13留', default: 0 })
-  lc_thirteen: number;
-
-  @Column({ comment: '目标14留', default: 0 })
-  lc_fourteen: number;
-
-  @Column({ comment: '目标15留', default: 0 })
-  lc_fifteen: number;
-
-  @Column({ comment: '目标16留', default: 0 })
-  lc_sixteen: number;
-
-  @Column({ comment: '目标17留', default: 0 })
-  lc_seventeen: number;
-
-  @Column({ comment: '目标18留', default: 0 })
-  lc_eighteen: number;
-
-  @Column({ comment: '目标19留', default: 0 })
-  lc_nineteen: number;
-
-  @Column({ comment: '目标20留', default: 0 })
-  lc_twenty: number;
-
-  @Column({ comment: '目标21留', default: 0 })
-  lc_twentyone: number;
-
-  @Column({ comment: '目标22留', default: 0 })
-  lc_twentytwo: number;
-
-  @Column({ comment: '目标23留', default: 0 })
-  lc_twentythree: number;
-
-  @Column({ comment: '目标24留', default: 0 })
-  lc_twentyfour: number;
-
-  @Column({ comment: '目标25留', default: 0 })
-  lc_twentyfive: number;
-
-  @Column({ comment: '目标26留', default: 0 })
-  lc_twentysix: number;
-
-  @Column({ comment: '目标27留', default: 0 })
-  lc_twentyseven: number;
-
-  @Column({ comment: '目标28留', default: 0 })
-  lc_twentyeight: number;
-
-  @Column({ comment: '目标29留', default: 0 })
-  lc_twentynine: number;
-
-  @Column({ comment: '目标30留', default: 0 })
-  lc_thirty: number;
-
-
-
-}

+ 0 - 135
cool-admin-midway-master/src/app/modules/hide/entity/hide_game_task.ts

@@ -1,135 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:27:08
- * @LastEditTime: 2022-04-24 13:34:48
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\hide_game_task.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { Column, PrimaryColumn, Index } from 'typeorm';
-
-/**
- * 隐藏任务表
- */
-@EntityModel('hide_game_task')
-export class HideGameTaskEntity {
-  // @Index()
-  // @PrimaryColumn({ comment: '自增id' })
-  // id: number;
-
-  @Index()
-  @PrimaryColumn({ comment: '任务id' })
-  id: string;
-
-  @Index()
-  @Column({ comment: '任务名', length: 100 })
-  task_name: string;
-
-  @Index()
-  @Column({ type: 'date', comment: '目标日期,任务可能不是当天跑' })
-  new_date: Date;
-
-  @Column({ comment: '创建时间' })
-  createTime: Date;
-
-  @Column({ comment: '更新时间' })
-  updateTime: Date;
-
-  @Column({ comment: '新增下限' })
-  target_new_low: number;
-
-  @Column({ comment: '新增上限' })
-  target_new_high: number;
-
-  @Column({ comment: '付费下限' })
-  target_pay_low: number;
-
-  @Column({ comment: '付费上限' })
-  target_pay_high: number;
-
-  @Column({ comment: '活跃下限,有新增目标的游戏可不填' })
-  target_active_low: number;
-
-  @Column({ comment: '活跃上限,有新增目标的游戏可不填' })
-  target_active_high: number;
-
-  @Column({ comment: '付费单价下限', type: 'decimal', default: 6.00, scale: 2 })
-  unit_price_low: number;
-
-  @Column({ comment: '付费单价上限', type: 'decimal', default: 6.00, scale: 2 })
-  unit_price_high: number;
-
-  @Column({ type: "double", comment: '次留比例', default: 0.5, scale: 2 })
-  lc_two_ratio: number;
-
-  @Column({ type: "double", comment: '3留比例', default: 0.45, scale: 2 })
-  lc_three_ratio: number;
-
-  @Column({ type: "double", comment: '4留比例', default: 0.4, scale: 2 })
-  lc_four_ratio: number;
-
-  @Column({ type: "double", comment: '5留比例', default: 0.35, scale: 2 })
-  lc_five_ratio: number;
-
-  @Column({ type: "double", comment: '6留比例', default: 0.3, scale: 2 })
-  lc_six_ratio: number;
-
-  @Column({ type: "double", comment: '7留比例', default: 0.25, scale: 2 })
-  lc_seven_ratio: number;
-
-  @Column({ type: "double", comment: '8留比例', default: 0.2, scale: 2 })
-  lc_eight_ratio: number;
-
-  @Column({ type: "double", comment: '15留比例', default: 0.1, scale: 2 })
-  lc_fifteen_ratio: number;
-
-  @Column({ type: "double", comment: '30留比例', default: 0.01, scale: 2 })
-  lc_thirty_ratio: number;
-
-  @Column({ comment: '终止任务时间', default: '2099-01-01 00:00:00' })
-  stopTime: Date;
-
-  @Column({ comment: '终止任务原因', nullable: true })
-  stopRemark: string;
-
-  @Column({ comment: '备注', nullable: true })
-  remark: string;
-
-  @Column({ comment: '是否在执行数优 0:否 1:是', default: 1, type: 'tinyint' })
-  is_run: number;
-
-  @Column({ comment: '是否重复游戏 0:否 1:是', default: 0, type: 'tinyint' })
-  is_repeat: number;
-
-
-  // 游戏ID列表
-  gameIdList: number[];
-
-  // 文件列表
-  // fileList: number[];
-
-  @Column({ comment: '游戏端口id' })
-  game_agentId: number;
-
-  @Column({ comment: '登录方式id' })
-  login_modeId: number;
-
-  @Column({ comment: '账号类型id' })
-  account_typeId: number;
-
-  @Column({ comment: '负责人id' })
-  directorId: number;
-
-  // @Column({ comment: '小绵羊后台游戏id(如果是小绵羊游戏则填写)', length: 50, nullable: true })
-  // xmy_id: string;
-
-  // @Column({ comment: '腾讯游戏渠道id(如果是腾讯游戏则填写)', length: 50, nullable: true })
-  // qq_channel: string;
-
-  // @Column({ comment: '腾讯后台游戏id(如果是腾讯游戏则填写)', length: 50, nullable: true })
-  // qq_id: string;
-
-  @Column({ comment: '下载链接', nullable: true })
-  download: string;
-
-}

+ 0 - 29
cool-admin-midway-master/src/app/modules/hide/entity/hide_lo_mode.ts

@@ -1,29 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 16:39:11
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\lo_mode.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 游戏登录方式
- */
-@EntityModel('hide_lo_mode')
-export class HideLoModeEntity extends BaseEntity {
-  @Column({ comment: '登录方式' })
-  name: string;
-
-  @Column({ comment: '描述' })
-  description: string;
-
-  @Column({ comment: '显示顺序', nullable: true })
-  sort: number;
-
-  @Column({ comment: '该登录方式下游戏数量', default: 0 })
-  game_count: number;
-
-}

+ 0 - 57
cool-admin-midway-master/src/app/modules/hide/entity/hide_task_account_record.ts

@@ -1,57 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-21 18:23:13
- * @LastEditTime: 2022-04-21 16:40:31
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\task_account_record.ts
- */
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 任务账号记录表
- */
-@EntityModel('hide_task_account_record')
-@Index(["task_id", "account_id"], { unique: true }) // 联合索引
-export class HideTaskAccountRecordEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '任务id' })
-  task_id: string;
-
-  @Index()
-  @Column({ comment: '账号id' })
-  account_id: string;
-
-  @Index()
-  @Column({ type: 'date', comment: '新增日期' })
-  new_date: Date;
-
-  @Column({ comment: '取号时间(新增)', nullable: true })
-  getTimeNew: Date;
-
-  @Column({ comment: '取号时间(留存)', nullable: true })
-  getTimeRetained: Date;
-
-  @Column({ comment: '成功时间(新增)', nullable: true })
-  successTimeNew: Date;
-
-  @Column({ comment: '成功时间(留存)', nullable: true })
-  successTimeRetained: Date;
-
-  @Column({ comment: '账号所处状态 0.正常 1.冻结 2.密错 3.禁用 5.人脸验证', default: 0, type: 'tinyint' })
-  statusNew: number;
-
-  @Column({ comment: '账号所处状态 0.正常 1.冻结 2.密错 3.禁用 -1.账号被取 5.人脸验证', default: 0, type: 'tinyint' })
-  statusRetained: number;
-
-  @Column({ comment: '新增成功标识 0.未成功 1.成功 2.新增出现留存', default: 0, type: 'tinyint' })
-  ok_new: number;
-
-  // 2留账号取走未还状态:-2; 3留账号取走未还状态:-3
-  @Column({ comment: '留存成功标识 0.未成功 2.2留成功,3.3留成功 4.4留成功...', default: 0, type: 'tinyint' })
-  ok_retained: number;
-
-
-}

+ 0 - 27
cool-admin-midway-master/src/app/modules/hide/entity/hide_task_game_record.ts

@@ -1,27 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 16:34:31
- * @LastEditTime: 2022-04-21 16:55:14
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\entity\hide_task_game_record.ts
- */
-
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column, Index } from 'typeorm';
-
-/**
- * 任务游戏记录表
- */
-
-@EntityModel('hide_task_game_record')
-export class HideTaskGameRecordEntity extends BaseEntity {
-
-  @Index()
-  @Column({ comment: '任务id', length: 50 })
-  task_id: string;
-
-  @Column({ comment: '游戏id' })
-  game_id: number;
-
-}

+ 0 - 111
cool-admin-midway-master/src/app/modules/hide/service/createTable.ts

@@ -1,111 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-24 18:24:11
- * @LastEditTime: 2022-04-24 22:31:33
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\createTable.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import * as _ from 'lodash';
-import { getConnection, Table } from 'typeorm';
-
-@Provide()
-export class createTableService extends BaseService {
-    async createAccountTable(task_id: string) {
-        let taskAccount = {
-            name: "hide_game_account_" + task_id,
-            columns: [
-                {
-                    name: "id",
-                    type: "int",
-                    isPrimary: true,
-                    length: "11"
-                }, {
-                    name: "account_text",
-                    type: "varchar",
-                    length: "50",
-                    comment: "账号"
-                }, {
-                    name: "password_text",
-                    type: "varchar",
-                    length: "50",
-                    comment: "密码"
-                }, {
-                    name: "new_date",
-                    type: "date",
-                    comment: "日期"
-                }, {
-                    name: "vpn_text",
-                    type: "varchar",
-                    length: "50",
-                    comment: "vpn域"
-                }, {
-                    name: "manufacturer",
-                    type: "varchar",
-                    length: "50",
-                    comment: "厂商"
-                }, {
-                    name: "model",
-                    type: "varchar",
-                    length: "50",
-                    comment: "型号"
-                }, {
-                    name: "pnumber",
-                    type: "varchar",
-                    length: "50",
-                    comment: "手机号码"
-                }, {
-                    name: "imei",
-                    type: "varchar",
-                    length: "50",
-                    comment: "imei"
-                }, {
-                    name: "imsi",
-                    type: "varchar",
-                    length: "50",
-                    comment: "imsi"
-                }, {
-                    name: "simserial",
-                    type: "varchar",
-                    length: "50",
-                    comment: "序列号"
-                }, {
-                    name: "androidid",
-                    type: "varchar",
-                    length: "50",
-                    comment: "安卓id"
-                }, {
-                    name: "mac",
-                    type: "varchar",
-                    length: "50",
-                    comment: "mac地址"
-                }, {
-                    name: "type_id",
-                    type: "varchar",
-                    length: "50",
-                    comment: "账号类型id"
-                }, {
-                    name: "status",
-                    type: "tinyint",
-                    length: "4",
-                    default: 0,
-                    comment: "账号所处状态 0.正常 1.冻结 2.密错 3.禁用 5.人脸验证 6.信用分不足"
-                }
-                //账号冻结时间
-                //新增成功标识
-                //留存成功标识
-                //新增取号具体时间
-                //留存取号具体时间
-
-            ]
-        }
-        const queryRunner = await getConnection().createQueryRunner();
-        await queryRunner.createTable(new Table(taskAccount), true);
-        await queryRunner.release();
-
-
-    }
-
-
-}

+ 0 - 144
cool-admin-midway-master/src/app/modules/hide/service/hide_game_account.ts

@@ -1,144 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-22 13:59:30
- * @LastEditTime: 2022-04-21 17:06:30
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_account.ts
- */
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import { HideGameAccountEntity } from '../entity/hide_game_account';
-import * as _ from 'lodash';
-import { Utils } from '../../../comm/utils';
-
-/**
- * 
- */
-@Provide()
-export class HideGameAccountService extends BaseService {
-  @InjectEntityModel(HideGameAccountEntity)
-  HideGameAccountEntity: Repository<HideGameAccountEntity>;
-
-  @Inject()
-  utils: Utils;
-  /***
-   * 批量插入数据库
-   */
-  async batchAdd(id_card: any) {
-    let idCard = id_card
-    // const returnMsg = await this.HideGameAccountEntity
-    //   .createQueryBuilder()
-    //   .insert()
-    //   .into(HideGameAccountEntity)
-    //   .values(idCard)
-    //   .execute();
-    const sqlBatchAdd = `
-      insert 
-        IGNORE into 
-        hide_game_account (account_text,
-          password_text,
-          vpn_text,
-          manufacturer,
-          model,
-          pnumber,
-          imei,
-          imsi,
-          simserial,
-          androidid,
-          mac,
-          type_id,
-          status,
-          remark) 
-        values
-    `+ idCard;
-    return await this.nativeQuery(sqlBatchAdd);
-  }
-
-  /**
-    * 重写分页查询
-    * @param query
-    */
-  async page(query) {
-    const { type_name, account_text, password_text } = query;
-    const sql = `
-        SELECT
-          a.id,a.createTime,a.updateTime,a.remark,a.account_text,a.password_text,a.vpn_text,a.manufacturer,a.model,a.pnumber,a.imei,
-          a.imsi,a.simserial,a.androidid,a.mac,a.status,a.frozenTime,a.getTime,a.occupy_taskId,a.releaseTime,a.type_id,
-          b.name AS type_name
-        FROM
-        hide_game_account a
-          LEFT JOIN hide_account_type b ON a.type_id = b.id
-        WHERE 1 = 1
-          ${this.setSql(type_name, 'and b.name = ?', [type_name])}
-          ${this.setSql(account_text, 'and a.account_text LIKE ?', [`%${account_text}%`])}
-          ${this.setSql(password_text, 'and a.account_text LIKE ?', [`%${password_text}%`])}
-      `;
-    return this.sqlRenderPage(sql, query);
-  }
-
-  /**
-   *
-   * 修改账号被占用的任务id
-   * @param {number} accountId
-   * @param {string} task_id
-   * @return {*} 
-   * @memberof HideGameAccountService
-   */
-  async updateOccupy(accountId: number, task_id: string) {
-    const updateResult = await this.HideGameAccountEntity
-      .createQueryBuilder()
-      .update()
-      .set({
-        occupy_taskId: task_id,
-        getTime: new Date()
-      })
-      .where('id = :id', {
-        id: accountId
-      })
-      .execute();
-    if (updateResult.affected >= 1) {
-      return { code: 1, message: '修改成功!' }
-    } else {
-      return { code: -1, message: '修改失败!' }
-    }
-  }
-
-  /**
-   *
-   * 修改GameAccount表账号状态
-   * @param {*} account_id
-   * @param {number} status 0.正常 1.冻结 2.密错 3.禁用 5.人脸验证
-   * @return {*} 
-   * @memberof HideGameAccountService
-   */
-  async updateAccountState(account_id, status: number) {
-    // status 0.正常 1.冻结 2.密错 3.禁用 5.人脸验证
-    const exists = await this.HideGameAccountEntity.findOne({
-      id: account_id
-    });
-    if (exists) {
-      exists.occupy_taskId = '0'
-      if (status == 1) {
-        exists.status = 1
-        exists.frozenTime = new Date()
-      } else if (status == 2) {
-        exists.status = 2
-        exists.frozenTime = new Date()
-      } else if (status == 3) {
-        exists.status = 3
-        exists.frozenTime = new Date()
-      } else if (status == 5) {
-        exists.status = 5
-        exists.frozenTime = new Date()
-      }
-      await this.HideGameAccountEntity.save(exists);
-      return 1
-    } else {
-      return -1
-    }
-  }
-
-
-}

+ 0 - 52
cool-admin-midway-master/src/app/modules/hide/service/hide_game_account_record.ts

@@ -1,52 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-02-17 16:27:22
- * @LastEditTime: 2022-04-22 23:06:17
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_account_record.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideGameAccountRecordEntity } from '../entity/hide_game_account_record';
-// import { Utils } from '../../../comm/utils';
-
-/**
- * 商品
- */
-@Provide()
-export class HideGameAccountRecordService extends BaseService {
-
-  @InjectEntityModel(HideGameAccountRecordEntity)
-  HideGameAccountRecordEntity: Repository<HideGameAccountRecordEntity>;
-
-  // @Inject()
-  // utils: Utils;
-  /**
-    * 重写分页查询
-    * @param query
-    */
-  async page(query) {
-    const { account_text, game_name } = query;
-    const sql = `
-        SELECT
-          a.id,a.createTime,a.updateTime,a.account_id,a.game_id,
-          b.account_text,b.status,c.game_name,c.game_agentId,c.login_modeId
-        FROM
-          hide_game_account_record a
-          LEFT JOIN hide_game_account b ON a.account_id = b.id
-          LEFT JOIN hide_game_list c ON a.game_id = c.id
-        WHERE 1 = 1
-          ${this.setSql(account_text, 'and b.account_text LIKE ?', [`%${account_text}%`])}
-          ${this.setSql(game_name, 'and c.game_name LIKE ?', [`%${game_name}%`])}
-      `;
-    return this.sqlRenderPage(sql, query);
-  }
-
-
-
-
-
-}

+ 0 - 72
cool-admin-midway-master/src/app/modules/hide/service/hide_game_account_temp.ts

@@ -1,72 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-22 13:59:30
- * @LastEditTime: 2022-04-24 14:21:11
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_account_temp.ts
- */
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import { HideGameAccountTempEntity } from '../entity/hide_game_account_temp';
-import * as _ from 'lodash';
-import { Utils } from '../../../comm/utils';
-
-/**
- * 
- */
-@Provide()
-export class HideGameAccountTempService extends BaseService {
-  @InjectEntityModel(HideGameAccountTempEntity)
-  HideGameAccountTempEntity: Repository<HideGameAccountTempEntity>;
-
-  @Inject()
-  utils: Utils;
-  /***
-   * 批量插入数据库
-   */
-  async batchAdd(id_card: any) {
-    let idCard = id_card
-    const sqlBatchAdd = `
-      insert 
-        IGNORE into 
-        hide_game_account_temp (account_text,
-          password_text,
-          remark) 
-        values
-    `+ idCard;
-    return await this.nativeQuery(sqlBatchAdd);
-  }
-
-  /**
-   * 对比临时表和账号表,找出账号表中已存在的数据
-   * @param {number} type_id
-   * @return {*} 
-   * @memberof HideGameAccountTempService
-   */
-  async contrastData(type_id: number) {
-    const sql = `
-      select 
-        account_text,password_text,remark 
-      from hide_game_account_temp A 
-      where exists(
-        select account_text from hide_game_account where type_id = `+ type_id + ` and account_text=A.account_text)
-    `
-    return await this.nativeQuery(sql);
-  }
-
-  /**
-   *
-   *  清空临时表
-   * @memberof HideGameAccountTempService
-   */
-  async deleteAll() {
-    await this.HideGameAccountTempEntity
-      .createQueryBuilder()
-      .delete()
-      .execute();
-  }
-
-
-}

+ 0 - 115
cool-admin-midway-master/src/app/modules/hide/service/hide_game_agent.ts

@@ -1,115 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:05:47
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_agent.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideGameAgentEntity } from '../entity/hide_game_agent';
-
-/**
- * 游戏目标
- */
-@Provide()
-export class HideGameAgentService extends BaseService {
-
-  @InjectEntityModel(HideGameAgentEntity)
-  HideGameAgentEntity: Repository<HideGameAgentEntity>;
-
-  /**
-   * 厂商对应的游戏数量+1
-   * @param {*} game_agentId
-   * @memberof HideGameAgentService
-   */
-  async recordGameNum(game_agentId: number) {
-    if (game_agentId) {
-      const gameAgentEntity = await this.HideGameAgentEntity.findOne(game_agentId);
-      gameAgentEntity.game_count = gameAgentEntity.game_count + 1;
-      await this.HideGameAgentEntity.save(gameAgentEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   * 厂商对应的游戏数量-1
-   * @param {*} game_agentId
-   * @memberof HideGameAgentService
-   */
-  async reduceGameNum(game_agentId: number) {
-    if (game_agentId) {
-      const gameAgentEntity = await this.HideGameAgentEntity.findOne(game_agentId);
-      gameAgentEntity.game_count = gameAgentEntity.game_count - 1;
-      await this.HideGameAgentEntity.save(gameAgentEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *减少游戏数量by name
-   * @param {*} name
-   * @return {*} 
-   * @memberof HideGameAgentService
-   */
-  async reduceGameNumByname(name: any) {
-    if (name) {
-      const gameAgentEntity = await this.HideGameAgentEntity.findOne({
-        name: name
-      });
-      gameAgentEntity.game_count = gameAgentEntity.game_count - 1;
-      await this.HideGameAgentEntity.save(gameAgentEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *增加游戏数量by name
-   * @param {*} name
-   * @return {*} 
-   * @memberof HideGameAgentService
-   */
-  async addGameNumByname(name: any) {
-    if (name) {
-      const gameAgentEntity = await this.HideGameAgentEntity.findOne({
-        name: name
-      });
-      gameAgentEntity.game_count = gameAgentEntity.game_count + 1;
-      await this.HideGameAgentEntity.save(gameAgentEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-
-
-  //  /**
-  //  * 重写分页查询
-  //  * @param query
-  //  */
-  // async page(query) {
-  //   const { pc_name, is_rent,shop_name,is_abnormal } = query;
-  //   const sql = `
-  //         SELECT
-  //           *
-  //         FROM
-  //           hide_game_computer
-  //         WHERE 1 = 1
-  //           ${this.setSql(pc_name, 'and pc_name LIKE ?', [`%${pc_name}%`])}
-  //           ${this.setSql(is_rent, 'and is_rent = ?', [is_rent])}
-  //           ${this.setSql(shop_name, 'and shop_name LIKE ?', [`%${shop_name}%`])}
-  //           ${this.setSql(is_abnormal, 'and is_abnormal = ?', [is_abnormal])}
-  //       `;
-  //   return this.sqlRenderPage(sql, query);
-  // }
-
-
-}

+ 0 - 53
cool-admin-midway-master/src/app/modules/hide/service/hide_game_complete.ts

@@ -1,53 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 17:00:17
- * @LastEditTime: 2022-04-21 17:05:25
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_complete.ts
- */
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideGameCompleteEntity } from '../entity/hide_game_complete';
-import { ILogger } from '@midwayjs/logger';
-import { HideGameTaskEntity } from '../entity/hide_game_task';
-import { Utils } from '../../../comm/utils';
-/**
- * 游戏目标
- */
-@Provide()
-export class HideGameCompleteService extends BaseService {
-
-  @InjectEntityModel(HideGameCompleteEntity)
-  HideGameCompleteEntity: Repository<HideGameCompleteEntity>;
-
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  utils: Utils;
-
-  /**
-   * 添加任务完成
-   */
-  async addComplete(queryObject: HideGameTaskEntity) {
-    const gameCompleteEntity = await this.HideGameCompleteEntity.findOne({
-      task_id: queryObject.id,
-      new_date: this.utils.formatDate(new Date())
-    });
-
-    let obj = {
-      task_id: queryObject.id,
-      task_name: queryObject.task_name,
-      new_date: this.utils.formatDate(new Date()),
-      updateTime: new Date()
-    }
-    if (!gameCompleteEntity) {
-      //不存在,则新建
-      await this.HideGameCompleteEntity.insert(obj)
-    }
-  }
-
-}

+ 0 - 96
cool-admin-midway-master/src/app/modules/hide/service/hide_game_director.ts

@@ -1,96 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:04:48
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_director.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideGameDirectorEntity } from '../entity/hide_game_director';
-
-/**
- * 游戏负责人
- */
-@Provide()
-export class HideGameDirectorService extends BaseService {
-
-  @InjectEntityModel(HideGameDirectorEntity)
-  HideGameDirectorEntity: Repository<HideGameDirectorEntity>;
-
-  /**
-   * 重写list查询
-   * @param {*} query
-   * @return {*} 
-   * @memberof HideGameDirectorService
-   */
-  async list(query) {
-    const sql = `
-          SELECT
-            *
-          FROM
-            hide_game_director
-          WHERE status = 1
-        `;
-    return this.nativeQuery(sql, query);
-  }
-
-  /**
-   *  
-   * @param {*} names
-   * @return {*} 
-   * @memberof HideGameDirectorService
-   */
-  async queryPhoneByNames(names: any) {
-    const sql = `
-          SELECT phone
-          FROM hide_game_director
-          WHERE 
-        `+ names;
-    return this.nativeQuery(sql);
-  }
-
-  /**
-   *
-   *减少游戏数量by id
-   * @param {*} id
-   * @return {*} 
-   * @memberof HideGameDirectorService
-   */
-  async reduceGameNumById(id: number) {
-    if (id) {
-      const gameGameDirectorEntity = await this.HideGameDirectorEntity.findOne({
-        id: id
-      });
-      gameGameDirectorEntity.game_count = gameGameDirectorEntity.game_count - 1;
-      await this.HideGameDirectorEntity.save(gameGameDirectorEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *增加游戏数量by id
-   * @param {*} id
-   * @return {*} 
-   * @memberof HideGameDirectorService
-   */
-  async addGameNumById(id: number) {
-    if (id) {
-      const gameGameDirectorEntity = await this.HideGameDirectorEntity.findOne({
-        id: id
-      });
-      gameGameDirectorEntity.game_count = gameGameDirectorEntity.game_count + 1;
-      await this.HideGameDirectorEntity.save(gameGameDirectorEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-
-
-}

+ 0 - 63
cool-admin-midway-master/src/app/modules/hide/service/hide_game_list.ts

@@ -1,63 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:03:08
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_game_list.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import * as _ from 'lodash';
-
-/**
- * 游戏列表
- */
-@Provide()
-export class HideGameListService extends BaseService {
-
-
-  /**
-  * 重写分页查询
-  * @param query
-  */
-  async page(query) {
-    const { game_name, game_agent, login_mode } = query;
-    const sql = `
-          SELECT
-            a.id,a.createTime,a.updateTime,a.remark,a.game_name,a.game_agentId,a.login_modeId,
-            c.name AS game_agent,
-            b.name AS login_mode
-          FROM
-            hide_game_list a
-            LEFT JOIN hide_lo_mode b ON a.login_modeId = b.id
-            LEFT JOIN hide_game_agent c ON a.game_agentId = c.id
-          WHERE 1 = 1
-            ${this.setSql(game_name, 'and a.game_name LIKE ?', [`%${game_name}%`])}
-            ${this.setSql(game_agent, 'and c.name LIKE ?', [`%${game_agent}%`])}
-            ${this.setSql(login_mode, 'and b.name LIKE ?', [`%${login_mode}%`])}
-        `;
-    return this.sqlRenderPage(sql, query);
-  }
-
-  /**
-   * 重写list查询
-   * @param {*} query
-   * @return {*} 
-   * @memberof HideGameListService
-   */
-  async list(query) {
-    const sql = `
-        SELECT
-          a.id,
-          a.game_name,
-          c.name AS game_agent,
-          b.name AS login_mode
-        FROM
-          hide_game_list a
-          LEFT JOIN hide_lo_mode b ON a.login_modeId = b.id
-          LEFT JOIN hide_game_agent c ON a.game_agentId = c.id
-        `;
-    return this.nativeQuery(sql, query);
-  }
-
-}

+ 0 - 298
cool-admin-midway-master/src/app/modules/hide/service/hide_game_target.ts

@@ -1,298 +0,0 @@
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService, CoolCommException } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideGameTargetEntity } from '../entity/hide_game_target';
-import { ILogger } from '@midwayjs/logger';
-import { HideGameTaskEntity } from '../entity/hide_game_task';
-import { Utils } from '../../../comm/utils';
-/**
- * 游戏目标
- */
-@Provide()
-export class HideGameTargetService extends BaseService {
-
-  @InjectEntityModel(HideGameTargetEntity)
-  HideGameTargetEntity: Repository<HideGameTargetEntity>;
-
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  utils: Utils;
-
-  /**
-  * 重载修改接口
-  */
-  async update(param) {
-    console.log(param)
-    const exists = await this.HideGameTargetEntity.findOne({
-      id: param.id,
-    });
-    param.createTime = new Date()
-    param.updateTime = new Date()
-    if (!_.isEmpty(exists)) {
-      if (exists.target_new_low >= param.target_new) {
-        param.target_new_low = param.target_new
-      } else {
-        param.target_new_low = exists.target_new_low
-      }
-      if (exists.target_pay_low >= param.target_pay) {
-        param.target_pay_low = param.target_pay
-      } else {
-        param.target_pay_low = exists.target_pay_low
-      }
-      if (exists.target_active_low >= param.target_active) {
-        param.target_active_low = param.target_active
-      } else {
-        param.target_active_low = exists.target_active_low
-      }
-      let addObj = {
-        task_id: param.task_id,
-        task_name: param.task_name,
-        directorId: param.directorId,
-        new_date: param.new_date,
-        target_new: param.target_new,
-        target_pay: param.target_pay,
-        target_active: param.target_active,
-        target_new_low: param.target_new_low,
-        target_pay_low: param.target_pay_low,
-        target_active_low: param.target_active_low
-      }
-      const updateResult = await this.HideGameTargetEntity
-        .createQueryBuilder()
-        .update()
-        .set(addObj)
-        .where('id = :id', {
-          id: param.id,
-        })
-        .execute();
-      if (updateResult.affected >= 1) {
-        // throw new CoolCommException('修改成功~');
-        console.log('修改成功~')
-      } else {
-        // throw new CoolCommException('修改成功~');
-        console.log('修改失败~')
-      }
-    } else {
-      throw new CoolCommException('未查询到数据,无法修改~');
-    }
-  }
-  /**
-   * 修改目标
-   */
-  async updateTarget(task_id: string, new_date: Date) {
-    const gameTargetEntity = await this.HideGameTargetEntity.findOne({
-      task_id: task_id,
-      new_date: new_date
-    });
-    // this.logger.warn(task_id)
-    // this.logger.warn(new_date)
-    // this.logger.warn(gameTargetEntity)
-    if (gameTargetEntity) {
-      let targetValue = {
-        updateTime: new Date(),
-        target_new: 0,
-        target_pay: 0,
-        target_active: 0,
-        lc_two: 0,
-        lc_three: 0,
-        lc_four: 0,
-        lc_five: 0,
-        lc_six: 0,
-        lc_seven: 0,
-        lc_eight: 0,
-        lc_nine: 0,
-        lc_ten: 0,
-        lc_eleven: 0,
-        lc_twelve: 0,
-        lc_thirteen: 0,
-        lc_fourteen: 0,
-        lc_fifteen: 0,
-        lc_sixteen: 0,
-        lc_seventeen: 0,
-        lc_eighteen: 0,
-        lc_nineteen: 0,
-        lc_twenty: 0,
-        lc_twentyone: 0,
-        lc_twentytwo: 0,
-        lc_twentythree: 0,
-        lc_twentyfour: 0,
-        lc_twentyfive: 0,
-        lc_twentysix: 0,
-        lc_twentyseven: 0,
-        lc_twentyeight: 0,
-        lc_twentynine: 0,
-        lc_thirty: 0
-      }
-      const updateResult = await this.HideGameTargetEntity
-        .createQueryBuilder()
-        .update()
-        .set(targetValue)
-        .where('task_id = :task_id and new_date = :new_date', {
-          task_id: task_id,
-          new_date: new_date
-        })
-        .execute();
-      // this.logger.warn(updateResult)
-      const deleteResult = await this.HideGameTargetEntity
-        .createQueryBuilder()
-        .delete()
-        .where('task_id = :task_id and new_date > :new_date', {
-          task_id: task_id,
-          new_date: new_date
-        }).execute()
-      // this.logger.warn(deleteResult)
-      if (updateResult.affected >= 1 && deleteResult.affected >= 0) {
-        return 1000
-      } else {
-        return -1
-      }
-    } else {
-      return -1
-    }
-  }
-  /**
-   * 添加指定任务目标
-   */
-  async addTarget(queryObject: HideGameTaskEntity) {
-    const gameTargetEntity = await this.HideGameTargetEntity.findOne({
-      task_id: queryObject.id,
-      new_date: this.utils.formatDate(new Date())
-    });
-    // this.logger.warn(gameTargetEntity)
-    let target_new = 0
-    let target_pay = 0
-    let target_active = 0
-    target_new = Math.floor(Math.random() * (queryObject.target_new_high - queryObject.target_new_low + 1) + queryObject.target_new_low)
-    target_pay = Math.floor(Math.random() * (queryObject.target_pay_high - queryObject.target_pay_low + 1) + queryObject.target_pay_low)
-    target_active = Math.floor(Math.random() * (queryObject.target_active_high - queryObject.target_active_low + 1) + queryObject.target_active_low)
-    // this.logger.warn(queryObject.directorId)
-    let targetObj = {
-      task_id: queryObject.id,
-      task_name: queryObject.task_name,
-      directorId: queryObject.directorId,
-      new_date: this.utils.formatDate(new Date()),
-      updateTime: new Date(),
-      target_new: target_new,
-      target_pay: target_pay,
-      target_active: target_active
-      // lc_two: 0,
-      // lc_three: 0,
-      // lc_four: 0,
-      // lc_five: 0,
-      // lc_six: 0,
-      // lc_seven: 0,
-      // lc_eight: 0,
-      // lc_nine: 0,
-      // lc_ten: 0,
-      // lc_eleven: 0,
-      // lc_twelve: 0,
-      // lc_thirteen: 0,
-      // lc_fourteen: 0,
-      // lc_fifteen: 0,
-      // lc_sixteen: 0,
-      // lc_seventeen: 0,
-      // lc_eighteen: 0,
-      // lc_nineteen: 0,
-      // lc_twenty: 0,
-      // lc_twentyone: 0,
-      // lc_twentytwo: 0,
-      // lc_twentythree: 0,
-      // lc_twentyfour: 0,
-      // lc_twentyfive: 0,
-      // lc_twentysix: 0,
-      // lc_twentyseven: 0,
-      // lc_twentyeight: 0,
-      // lc_twentynine: 0,
-      // lc_thirty: 0
-    }
-    if (gameTargetEntity) { //已存在,则更新
-      const updateResult = await this.HideGameTargetEntity
-        .createQueryBuilder()
-        .update()
-        .set(targetObj)
-        .where('task_id = :task_id and new_date = :new_date', {
-          task_id: queryObject.id,
-          new_date: this.utils.formatDate(new Date())
-        })
-        .execute();
-      // this.logger.warn(updateResult)
-      if (updateResult.affected >= 1) {
-        return 1000
-      } else {
-        return -1
-      }
-    } else {
-      //不存在,则新建
-      await this.HideGameTargetEntity.insert(targetObj)
-    }
-  }
-  /**
-  * 重写分页查询
-  * @param query
-  */
-  async page(query) {
-    let { task_id, task_name, new_date, directorId, is_complete, login_modeId, game_agentId } = query;
-    // if (!new_date) {
-    //   new_date = this.utils.formatDate(new Date())
-    // }
-    const sql = `
-            SELECT
-              a.id,a.task_id,a.task_name,DATE_FORMAT(a.new_date,'%Y-%m-%d') AS new_date,a.target_new,a.target_pay,a.target_active,
-              IFNULL(c.complete_new, 0) AS complete_new,IFNULL(c.complete_pay, 0) AS complete_pay,game_rate,game_rate_xmy,
-              IFNULL(c.complete_active,0) AS complete_active,c.updateTime,c.is_complete,c.amount,
-              b.name AS directorName,b.id AS directorId,t.login_modeId AS login_modeId,
-              if(a.target_new - complete_new < 0, 0, a.target_new-complete_new) AS incomplete_new,
-              if(a.target_pay - complete_pay < 0, 0, a.target_pay-complete_pay) AS incomplete_pay,
-              if(a.target_active - complete_active < 0, 0, a.target_active-complete_active) AS incomplete_active
-            FROM
-              hide_game_target a
-              LEFT JOIN hide_game_task t ON a.task_id = t.id
-              LEFT JOIN hide_game_director b ON a.directorId = b.id
-              LEFT JOIN hide_game_complete c ON a.task_id = c.task_id AND a.new_date = c.new_date 
-            WHERE
-              1 = 1
-            ${this.setSql(task_id, 'and a.task_id LIKE ?', [`%${task_id}%`])}
-            ${this.setSql(task_name, 'and a.task_name LIKE ?', [`%${task_name}%`])}
-            ${this.setSql(directorId, 'and b.id = ?', [directorId])}
-            ${this.setSql(login_modeId, 'and t.login_modeId = ?', [login_modeId])}
-            ${this.setSql(game_agentId, 'and t.game_agentId = ?', [game_agentId])}
-            ${this.setSql(new_date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
-            ${this.setSql(is_complete, 'and c.is_complete = ?', [is_complete])}
-        `;
-    return this.sqlRenderPage(sql, query);
-  }
-  /**
-  * 查询任务目标与完成
-  * @param query
-  */
-  async getTaskTAndC(queryObj) {
-    let { task_id, new_date } = queryObj
-    const sql = `
-          SELECT
-              a.task_id,a.task_name,a.target_new,a.target_pay,a.target_active,
-              IFNULL(c.complete_new, 0) AS complete_new,IFNULL(c.complete_pay, 0) AS complete_pay,
-              IFNULL(c.complete_active,0) AS complete_active,c.is_complete,c.amount,
-              b.name AS directorName,l.name AS login_mode,g.name AS game_agent,
-              if(a.target_new - complete_new < 0, 0, a.target_new-complete_new) AS incomplete_new,
-              if(a.target_pay - complete_pay < 0, 0, a.target_pay-complete_pay) AS incomplete_pay,
-              if(a.target_active - complete_active < 0, 0, a.target_active-complete_active) AS incomplete_active
-          FROM
-              hide_game_target a
-              LEFT JOIN hide_game_task t ON a.task_id = t.id
-              LEFT JOIN hide_game_director b ON a.directorId = b.id
-              LEFT JOIN hide_lo_mode l ON t.login_modeId = l.id
-              LEFT JOIN hide_game_agent g ON t.game_agentId = g.id
-              LEFT JOIN hide_game_complete c ON a.task_id = c.task_id AND a.new_date = c.new_date 
-          WHERE
-              1 = 1
-            ${this.setSql(task_id, 'and a.task_id = ?', [task_id])}
-            ${this.setSql(new_date, 'and a.new_date = ?', [this.utils.formatDate(new Date(new_date))])}
-        `;
-    // console.log(sql)
-    return this.nativeQuery(sql);
-  }
-
-}

+ 0 - 515
cool-admin-midway-master/src/app/modules/hide/service/hide_game_task.ts

@@ -1,515 +0,0 @@
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService, CoolCommException } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { ILogger } from '@midwayjs/logger';
-import { HideGameTaskEntity } from '../entity/hide_game_task';
-import { HideGameTargetEntity } from '../entity/hide_game_target';
-import { Utils } from '../../../comm/utils';
-import { HideGameCompleteEntity } from '../entity/hide_game_complete';
-import { HideGameAgentService } from './hide_game_agent';
-import { HideTaskGameRecordEntity } from '../entity/hide_task_game_record';
-import { HideLoModeService } from './hide_lo_mode';
-import { HideGameDirectorService } from './hide_game_director';
-import { createTableService } from './createTable';
-
-/**
- * 系统用户
- */
-@Provide()
-export class HideGameTaskService extends BaseService {
-
-  @InjectEntityModel(HideGameTaskEntity)
-  HideGameTaskEntity: Repository<HideGameTaskEntity>;
-
-  @InjectEntityModel(HideGameTargetEntity)
-  HideGameTargetEntity: Repository<HideGameTargetEntity>;
-
-  @InjectEntityModel(HideGameCompleteEntity)
-  HideGameCompleteEntity: Repository<HideGameCompleteEntity>;
-
-  @InjectEntityModel(HideTaskGameRecordEntity)
-  HideTaskGameRecordEntity: Repository<HideTaskGameRecordEntity>;
-
-  @Inject()
-  HideGameAgentService: HideGameAgentService;
-
-  @Inject()
-  HideLoModeService: HideLoModeService;
-
-  @Inject()
-  HideGameDirectorService: HideGameDirectorService;
-
-  @Inject()
-  logger: ILogger;
-
-  @Inject()
-  utils: Utils;
-
-  @Inject()
-  createTableService: createTableService;
-
-  /**
-   * 重载新增接口
-   */
-  async add(param) {
-    const existsTask = await this.HideGameTaskEntity.findOne({
-      id: param.id,
-    });
-    if (!_.isEmpty(existsTask)) {
-      throw new CoolCommException('已存在相同任务id~');
-    }
-    param.createTime = new Date()
-    param.updateTime = new Date()
-    //======================为每个任务单独生成一张账号表,用于存储留存账号
-    this.createTableService.createAccountTable(param.id)
-    // let taskAccount = {
-    //   name: "hide_game_account_" + param.id,
-    //   columns: [
-    //     {
-    //       name: "id",
-    //       type: "int",
-    //       isPrimary: true,
-    //       length: "11"
-    //     },
-    //     {
-    //       name: "account_text",
-    //       type: "varchar",
-    //       length: "50",
-    //       comment: "账号"
-    //     },
-    //     {
-    //       name: "password_text",
-    //       type: "varchar",
-    //       length: "50",
-    //       comment: "密码"
-    //     },
-    //     {
-    //       name: "new_date",
-    //       type: "date",
-    //       comment: "日期"
-    //     },
-    //     {
-    //       name: "vpn_text",
-    //       type: "varchar",
-    //       length: "50",
-    //       comment: "vpn域"
-    //     }, {
-    //       name: "manufacturer",
-    //       type: "varchar",
-    //       length: "50",
-    //       comment: "厂商"
-    //     }
-    //   ]
-    // }
-
-    // const queryRunner = await getConnection().createQueryRunner();
-    // await queryRunner.createTable(new Table(taskAccount), true);
-    // await queryRunner.release();
-    //======================
-
-
-    // console.log(param)
-    // 创建游戏目标start==========================
-    const existsTarget = await this.HideGameTargetEntity.findOne({
-      task_id: param.id,
-      new_date: param.new_date
-    });
-    let target_new = 0
-    let target_pay = 0
-    let target_active = 0
-    target_new = Math.floor(Math.random() * (parseInt(param.target_new_high) - parseInt(param.target_new_low) + 1) + parseInt(param.target_new_low))
-    target_pay = Math.floor(Math.random() * (parseInt(param.target_pay_high) - parseInt(param.target_pay_low) + 1) + parseInt(param.target_pay_low))
-    target_active = Math.floor(Math.random() * (parseInt(param.target_active_high) - parseInt(param.target_active_low) + 1) + parseInt(param.target_active_low))
-    //
-    if (!_.isEmpty(existsTarget)) {
-      // 当天的任务目标已存在,执行更新目标
-      let targetValue = {
-        task_name: param.task_name,
-        updateTime: param.updateTime,
-        target_new: target_new,
-        target_pay: target_pay,
-        target_active: target_active,
-        target_new_low: param.target_new_low,
-        target_pay_low: param.target_pay_low,
-        target_active_low: param.target_active_low
-      }
-      // this.logger.info(targetValue)
-      await this.HideGameTargetEntity
-        .createQueryBuilder()
-        .update()
-        .set(targetValue)
-        .where('task_id = :task_id and new_date = :new_date', {
-          task_id: param.id,
-          new_date: param.new_date
-        })
-        .execute();
-      // this.logger.info(updateResult) //UpdateResult { generatedMaps: [], raw: [], affected: 1 }
-      // 执行更新目标
-    } else {
-      // 添加任务目标
-      let targetValue = {
-        task_id: param.id,
-        task_name: param.task_name,
-        directorId: param.directorId,
-        new_date: param.new_date,
-        createTime: param.createTime,
-        updateTime: param.updateTime,
-        target_new: target_new,
-        target_pay: target_pay,
-        target_active: target_active,
-        target_new_low: param.target_new_low,
-        target_pay_low: param.target_pay_low,
-        target_active_low: param.target_active_low
-      }
-      // this.logger.info(targetValue)
-      await this.HideGameTargetEntity.insert(targetValue)
-    }
-    // 创建游戏目标end==========================
-    // 创建游戏完成game_complete===============================
-    const existsComplete = await this.HideGameCompleteEntity.findOne({
-      task_id: param.id,
-      new_date: param.new_date
-    })
-    if (_.isEmpty(existsComplete)) {
-      // 添加任务完成game_complete
-      let completeObj = {
-        task_id: param.id,
-        task_name: param.task_name,
-        new_date: param.new_date,
-        createTime: param.createTime,
-        updateTime: param.updateTime,
-        complete_new: 0,
-        complete_pay: 0,
-        complete_active: 0
-      }
-      // this.logger.info(completeObj)
-      await this.HideGameCompleteEntity.insert(completeObj)
-    }
-    // 创建游戏目标end==========================
-    // 记录端口对应的游戏数量start
-    await this.HideGameAgentService.recordGameNum(param.game_agentId)
-    // this.logger.info(returnMsg)
-    // 记录端口对应的游戏数量end
-    await this.updateTaskGame(param);
-    return super.add(param);
-  }
-
-  /**
-  * 重写分页查询
-  * @param query
-  */
-  async page(query) {
-    const { id, task_name, is_run, login_modeId, directorId, game_agentId, account_typeId } = query;
-    const sql = `
-            SELECT
-            a.id,a.task_name,a.new_date,a.createTime,a.updateTime,a.target_new_low,a.target_new_high,a.target_pay_low,a.target_pay_high,a.target_active_low,a.target_active_high,
-            a.lc_two_ratio,a.lc_three_ratio,a.lc_four_ratio,a.lc_five_ratio,a.lc_six_ratio,a.lc_seven_ratio,a.lc_eight_ratio,a.lc_fifteen_ratio,a.lc_thirty_ratio,a.stopTime,a.stopRemark,
-            a.remark,a.is_run,a.is_repeat,a.download,a.unit_price_low,a.unit_price_high,
-            any_value (b.name) AS directorName,b.id AS directorId,
-            any_value (c.name) AS login_modeId,
-            any_value (d.name) AS game_agentId,
-            any_value (e.name) AS account_typeId,
-            GROUP_CONCAT(g.game_name) AS gameList
-          FROM
-            hide_game_task a
-            LEFT JOIN hide_game_director b ON a.directorId = b.id
-            LEFT JOIN hide_lo_mode c ON a.login_modeId = c.id
-            LEFT JOIN hide_game_agent d ON a.game_agentId = d.id
-            LEFT JOIN hide_account_type e ON a.account_typeId = e.id
-            LEFT JOIN hide_task_game_record t ON a.id = t.task_id
-            LEFT JOIN hide_game_list g ON t.game_id = g.id
-          WHERE 1 = 1
-            ${this.setSql(id, 'and a.id = ?', [id])}
-            ${this.setSql(task_name, 'and a.task_name LIKE ?', [`%${task_name}%`])}
-            ${this.setSql(is_run, 'and a.is_run = ?', [is_run])}
-            ${this.setSql(directorId, 'and b.id = ?', [directorId])}
-            ${this.setSql(game_agentId, 'and d.id = ?', [game_agentId])}
-            ${this.setSql(account_typeId, 'and e.id = ?', [account_typeId])}
-            ${this.setSql(login_modeId, 'and c.id = ?', [login_modeId])}
-            GROUP BY a.id
-        `;
-    return this.sqlRenderPage(sql, query);
-  }
-
-  /**
-   * 根据ID获得信息
-   * @param id
-   */
-  public async info(id) {
-    const info = await this.HideGameTaskEntity.findOne({ id });
-    const gameIds = await this.nativeQuery(
-      'select a.game_id from hide_task_game_record a where a.task_id = ?',
-      [id]
-    );
-
-    if (info) {
-      // delete info.password;
-      if (gameIds) {
-        info.gameIdList = gameIds.map(e => {
-          return parseInt(e.game_id);
-        });
-      }
-    }
-    return info;
-  }
-  /**
-   * 修改
-   * @param param 数据
-   */
-  async update(param) {
-    // console.log(param)
-    const new_game_agentId = param.game_agentId
-    const new_login_modeId = param.login_modeId
-    const new_directorId = param.directorId
-    const new_task_name = param.task_name
-    const taskInfo = await this.HideGameTaskEntity.findOne({ id: param.id });
-    if (!taskInfo) {
-      throw new CoolCommException('任务不存在');
-    }
-    const old_game_agentId = taskInfo.game_agentId
-    const old_login_modeId = taskInfo.login_modeId
-    const old_directorId = taskInfo.directorId
-    const old_task_name = taskInfo.task_name
-    await this.HideGameTaskEntity.save(param);
-    await this.updateTaskGame(param);
-    //检测负责人-厂商-端口,如有变化,则更新对应数量
-    if (new_game_agentId != old_game_agentId) {
-      await this.HideGameAgentService.recordGameNum(new_game_agentId)
-      await this.HideGameAgentService.reduceGameNum(old_game_agentId)
-    }
-    if (new_login_modeId != old_login_modeId) {
-      await this.HideLoModeService.recordGameNum(new_game_agentId)
-      await this.HideLoModeService.reduceGameNum(old_game_agentId)
-    }
-    if (new_directorId != old_directorId) {
-      await this.HideGameDirectorService.addGameNumById(new_game_agentId)
-      await this.HideGameDirectorService.reduceGameNumById(old_game_agentId)
-    }
-    //修改当天任务表里的任务名称(当名称变化时)
-    if (old_task_name != new_task_name) {
-      const existsTarget = await this.HideGameTargetEntity.findOne({
-        task_id: param.id,
-        new_date: this.utils.formatDate(new Date())
-      });
-      if (!_.isEmpty(existsTarget)) {
-        // 当天的任务目标已存在,执行更新目标
-        let targetValue = {
-          task_name: new_task_name
-        }
-        // this.logger.info(targetValue)
-        await this.HideGameTargetEntity
-          .createQueryBuilder()
-          .update()
-          .set(targetValue)
-          .where('task_id = :task_id and new_date = :new_date', {
-            task_id: param.id,
-            new_date: this.utils.formatDate(new Date())
-          })
-          .execute();
-        // this.logger.info(updateResult) //UpdateResult { generatedMaps: [], raw: [], affected: 1 }
-      }
-    }
-
-  }
-  /**
-   * 更新任务-游戏关系
-   * @param taskGame
-   */
-  async updateTaskGame(taskGame) {
-    await this.HideTaskGameRecordEntity.delete({ task_id: taskGame.id });
-    if (taskGame.gameIdList) {
-      for (const game_id of taskGame.gameIdList) {
-        await this.HideTaskGameRecordEntity.save({ task_id: taskGame.id, game_id });
-      }
-    }
-  }
-
-  /**
-   * 删除
-   * @param ids
-   */
-  async delete(ids) {
-    let idArr;
-    console.log(ids)
-    if (ids instanceof Array) {
-      idArr = ids;
-    } else {
-      idArr = ids.split(',');
-    }
-    for (const id of idArr) {
-      //删除游戏时判断游戏是否在数优中,如在,则对应负责人,端口,厂商所属游戏数量-1
-      const taskInfo = await this.HideGameTaskEntity.findOne({ id: id });
-      if (taskInfo) {
-        // console.log(taskInfo)
-        if (taskInfo.is_run == 1) {
-          await this.HideGameAgentService.reduceGameNum(taskInfo.game_agentId)
-          await this.HideLoModeService.reduceGameNum(taskInfo.login_modeId)
-          await this.HideGameDirectorService.reduceGameNumById(taskInfo.directorId)
-        }
-      }
-      //===================================================================================
-      await this.HideTaskGameRecordEntity.delete({ task_id: id });
-      await this.HideGameTaskEntity.delete({ id: id });
-    }
-
-  }
-  /**
-     * 根据id删除任务
-     * @param id
-     */
-  async deleteById(id) {
-    //===================================================================================
-    // console.log(id)
-    // console.log(this.utils.formatDate(new Date()))
-    await this.HideTaskGameRecordEntity.delete({ task_id: id });
-    await this.HideGameTaskEntity.delete({ id: id });
-    await this.HideGameTargetEntity.delete({ task_id: id, new_date: this.utils.formatDate(new Date()) })
-    // await this.HideGameCompleteEntity.delete({ task_id: id, new_date: this.utils.formatDate(new Date()) })
-    return 1000
-  }
-  //
-  /**
-   *
-   *
-   * @param {string} task_id
-   * @param {Date} stopTime
-   * @param {string} stopRemark
-   * @return {*} 
-   * @memberof HideGameTaskService
-   */
-  async stopTask(task_id: string, stopTime: Date, stopRemark: string) {
-    // const { id_name } = query;
-    let obj = {
-      id: task_id
-    }
-    const HideGameTaskEntity = await this.HideGameTaskEntity.findOne(obj);
-    if (HideGameTaskEntity) {
-      if (new Date(stopTime).getTime() > new Date().getTime()) {
-        HideGameTaskEntity.is_run = 1;
-      } else {
-        HideGameTaskEntity.is_run = 0;
-      }
-      HideGameTaskEntity.stopTime = stopTime;
-      HideGameTaskEntity.stopRemark = stopRemark;
-      // this.logger.info(HideGameTaskEntity)
-      await this.HideGameTaskEntity.save(HideGameTaskEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *
-   * @param {string} task_id
-   * @return {*} 
-   * @memberof HideGameTaskService
-   */
-  async startTask(task_id: string) {
-    // const { id_name } = query;
-    let obj = {
-      id: task_id
-    }
-    const HideGameTaskEntity = await this.HideGameTaskEntity.findOne(obj);
-    if (HideGameTaskEntity) {
-      HideGameTaskEntity.is_run = 1;
-      HideGameTaskEntity.new_date = new Date(this.utils.formatDate(new Date()));
-      HideGameTaskEntity.stopTime = new Date('2099-01-01');
-      HideGameTaskEntity.stopRemark = '';
-      // this.logger.info(HideGameTaskEntity)
-      await this.HideGameTaskEntity.save(HideGameTaskEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-
-  /**
-   * 获取新增账号
-   * @param {*} task_id
-   * @param {*} account_typeId
-   * @return {*} 
-   * @memberof HideGameTaskService
-   */
-  async getAccountOne(task_id, account_typeId, account_state) {
-    const sql = `
-            SELECT
-              A.id AS id,
-              a.account_text,
-              a.password_text,
-              a.vpn_text,
-              a.manufacturer,
-              a.model,
-              a.pnumber,
-              a.imei,
-              a.imsi,
-              a.simserial,
-              a.androidid,
-              a.mac
-            FROM
-              hide_game_account AS A 
-            WHERE
-              1 = 1
-              ${this.setSql(account_typeId, 'and type_id = ?', [account_typeId])}
-              AND occupy_taskId = 0 
-              ${this.setSql(account_state, 'AND STATUS = ?', [account_state])}
-              AND 
-                ( SELECT count( 1 ) AS num FROM hide_task_account_record AS T WHERE A.id = T.account_id
-                  ${this.setSql(task_id, 'AND T.task_id = ?', [task_id])}
-                )= 0 
-              AND (
-                SELECT
-                  count( 1 ) AS num 
-                FROM
-                  game_account_record AS G 
-                WHERE
-                  G.game_id IN ( SELECT game_id FROM hide_task_game_record r WHERE 
-                    ${this.setSql(task_id, 'r.task_id = ?', [task_id])}
-                  ) 
-                  AND A.id = G.account_id 
-              )= 0 
-            ORDER BY
-              A.id 
-              LIMIT 1
-        `;
-    return this.nativeQuery(sql);
-  }
-
-  /**
-   * 获取留存账号
-   * @param {*} task_id
-   * @param {*} retained_day
-   * @return {*} 
-   * @memberof HideGameTaskService
-   */
-  async getAccountRetainedOne(task_id, retained_date) {
-    const sql = `
-        SELECT
-          A.id AS id,
-          b.account_text AS account_text,
-          b.password_text AS password_text,
-          b.vpn_text AS vpn_text,
-          b.manufacturer AS manufacturer,
-          b.model AS model,
-          b.pnumber AS pnumber,
-          b.imei AS imei,
-          b.imsi AS imsi,
-          b.simserial AS simserial,
-          b.androidid AS androidid,
-          b.mac AS mac
-        FROM
-          hide_task_account_record AS a
-          LEFT JOIN hide_game_account b ON a.account_id = b.id
-        WHERE
-          a.statusRetained = 0 AND a.ok_new = 1
-          ${this.setSql(task_id, 'AND a.task_id = ?', [task_id])}
-          ${this.setSql(retained_date, 'AND a.new_date = ?', [retained_date])}
-        ORDER BY
-          A.id 
-          LIMIT 1
-        `;
-    return this.nativeQuery(sql);
-  }
-}

+ 0 - 95
cool-admin-midway-master/src/app/modules/hide/service/hide_lo_mode.ts

@@ -1,95 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-21 17:08:00
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_lo_mode.ts
- */
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import * as _ from 'lodash';
-import { HideLoModeEntity } from '../entity/hide_lo_mode';
-
-/**
- * 游戏目标
- */
-@Provide()
-export class HideLoModeService extends BaseService {
-
-  @InjectEntityModel(HideLoModeEntity)
-  HideLoModeEntity: Repository<HideLoModeEntity>;
-
-  /**
-   * 端口对应的游戏数量+1
-   * @param {*} login_modeId
-   * @memberof HideLoModeService
-   */
-  async recordGameNum(login_modeId: number) {
-    if (login_modeId) {
-      const gameLoModeEntity = await this.HideLoModeEntity.findOne(login_modeId);
-      gameLoModeEntity.game_count = gameLoModeEntity.game_count + 1;
-      await this.HideLoModeEntity.save(gameLoModeEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   * 端口对应的游戏数量-1
-   * @param {*} login_modeId
-   * @memberof HideLoModeService
-   */
-  async reduceGameNum(login_modeId: number) {
-    if (login_modeId) {
-      const gameLoModeEntity = await this.HideLoModeEntity.findOne(login_modeId);
-      gameLoModeEntity.game_count = gameLoModeEntity.game_count - 1;
-      await this.HideLoModeEntity.save(gameLoModeEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *减少游戏数量by name
-   * @param {*} name
-   * @return {*} 
-   * @memberof HideLoModeService
-   */
-  async reduceGameNumByname(name: any) {
-    if (name) {
-      const gameLoModeEntity = await this.HideLoModeEntity.findOne({
-        name: name
-      });
-      gameLoModeEntity.game_count = gameLoModeEntity.game_count - 1;
-      await this.HideLoModeEntity.save(gameLoModeEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-  /**
-   *
-   *增加游戏数量by name
-   * @param {*} name
-   * @return {*} 
-   * @memberof HideLoModeService
-   */
-  async addGameNumByname(name: any) {
-    if (name) {
-      const gameLoModeEntity = await this.HideLoModeEntity.findOne({
-        name: name
-      });
-      gameLoModeEntity.game_count = gameLoModeEntity.game_count + 1;
-      await this.HideLoModeEntity.save(gameLoModeEntity);
-      return 1000
-    } else {
-      return -1
-    }
-  }
-
-
-
-}

+ 0 - 105
cool-admin-midway-master/src/app/modules/hide/service/hide_task_account_record.ts

@@ -1,105 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2021-12-22 13:59:30
- * @LastEditTime: 2022-04-21 17:08:30
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\service\hide_task_account_record.ts
- */
-import { Inject, Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import { HideTaskAccountRecordEntity } from '../entity/hide_task_account_record';
-import * as _ from 'lodash';
-import { Utils } from '../../../comm/utils';
-import { ILogger } from '@midwayjs/logger';
-
-/**
- * 
- */
-@Provide()
-export class HideTaskAccountRecordService extends BaseService {
-  @InjectEntityModel(HideTaskAccountRecordEntity)
-  HideTaskAccountRecordEntity: Repository<HideTaskAccountRecordEntity>;
-
-  @Inject()
-  utils: Utils;
-
-  @Inject()
-  logger: ILogger;
-
-  /**
-   *
-   * 修改TaskAccountRecord账号状态
-   * @param {number} record_id
-   * @param {number} status 0.新增留存成功 1.冻结 2.密错 3.禁用 4.新增出现留存 5.人脸验证
-   * @return {*} 
-   * @memberof HideTaskAccountRecordService
-   */
-  async updateAccount(record_id: number, status: number) {
-    // status 0.新增留存成功 1.冻结 2.密错 3.禁用 4.新增出现留存 5.人脸验证
-    const exists = await this.HideTaskAccountRecordEntity.findOne({
-      id: record_id
-    });
-    if (exists) {
-      const new_date = exists.new_date;
-      const today = this.utils.formatDate(new Date());
-      const dayDiff = this.utils.dateDiff(today, new_date)
-      let account_id = ''
-      if (dayDiff == 0) {
-        this.logger.warn(this.utils.timeDiff(new Date(), exists.getTimeNew))
-        if (this.utils.timeDiff(new Date(), exists.getTimeNew) > 7200) {
-          return { code: 2, message: '修改账号超时,只能修改2小时内取的账号' }
-        }
-        if (status == 0) {
-          exists.ok_new = 1;
-          exists.successTimeNew = new Date();
-        } else if (status == 4) {
-          exists.ok_new = 2;
-        } else if (status == 1) {
-          exists.ok_new = 0;
-          exists.statusNew = 1;
-        } else if (status == 2) {
-          exists.ok_new = 0;
-          exists.statusNew = 2;
-        } else if (status == 3) {
-          exists.ok_new = 0;
-          exists.statusNew = 3;
-        } else if (status == 5) {
-          exists.ok_new = 0;
-          exists.statusNew = 5;
-        }
-        const aa = await this.HideTaskAccountRecordEntity.save(exists);
-        account_id = aa.account_id
-      } else {
-        if (this.utils.timeDiff(new Date(), exists.getTimeRetained) > 7200) {
-          return { code: 2, message: '修改账号超时,只能修改2小时内取的账号' }
-        }
-        if (status == 0) {
-          exists.ok_retained = dayDiff + 1;
-          exists.successTimeRetained = new Date();
-        } else if (status == 1) {
-          exists.ok_retained = 0;
-          exists.statusRetained = 1;
-        } else if (status == 2) {
-          exists.ok_retained = 0;
-          exists.statusRetained = 2;
-        } else if (status == 3) {
-          exists.ok_retained = 0;
-          exists.statusRetained = 3;
-        } else if (status == 5) {
-          exists.ok_retained = 0;
-          exists.statusRetained = 5;
-        }
-        const bb = await this.HideTaskAccountRecordEntity.save(exists);
-        account_id = bb.account_id
-      }
-      return { code: 1, account_id: account_id }
-    } else {
-      return { code: -1 }
-    }
-  }
-
-
-
-}

+ 0 - 16
cool-admin-midway-master/src/app/modules/news/config.ts

@@ -1,16 +0,0 @@
-import { Application } from 'egg';
-import { ModuleConfig } from 'midwayjs-cool-core';
-
-/**
- * 示例
- */
-export default (app: Application) => {
-  return {
-    // 模块名称
-    name: 'news',
-    // 模块描述
-    description: '新闻模块',
-    // 中间件
-    middlewares: ['testMiddleware'],
-  } as ModuleConfig;
-};

+ 0 - 35
cool-admin-midway-master/src/app/modules/news/controller/admin/articles.ts

@@ -1,35 +0,0 @@
-import { Provide } from '@midwayjs/decorator';
-import { Context } from 'egg';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { NewsArticlesEntity } from '../../entity/articles';
-import { NewsArticlesService } from '../../service/articles';
-
-/**
- * 描述
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: NewsArticlesEntity,
-  service:NewsArticlesService,
-
-  // 向表插入当前登录用户ID
-  insertParam: async (ctx: Context) => {
-    return {
-      user_id: ctx.admin.userId,
-    };
-  },
-  // 分页查询配置
-//   pageQueryOp: {
-//     // 让字段支持模糊查询
-//     keyWordLikeFields: ['name','description'],
-//     // 让字段支持筛选
-//     fieldEq: ['name','description']
-
-//   },
-})
-export class NewsAdminArticlesController extends BaseController {
-
-}

+ 0 - 63
cool-admin-midway-master/src/app/modules/news/controller/admin/categories.ts

@@ -1,63 +0,0 @@
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-import { NewsCategoriesEntity } from '../../entity/categories';
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: NewsCategoriesEntity,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-  // 分页查询配置
-  pageQueryOp: {
-    // 让字段支持模糊查询
-    keyWordLikeFields: ['name','description'],
-    // 让字段支持筛选
-    fieldEq: ['name','description']
-  //   // 指定返回字段
-  //   select: ['a.*', 'b.name'],
-  //   // 关联表用户表
-  //   leftJoin: [
-  //     {
-  //       // 管理的表
-  //       entity: BaseSysUserEntity,
-  //       // 别名
-  //       alias: 'b',
-  //       // 关联条件
-  //       condition: 'a.userId = b.id',
-  //     },
-  //   ],
-  //   // 增加其他条件
-  //   where: async (ctx: Context) => {
-  //     return [
-  //       // 价格大于90
-  //       ['a.price > :price', { price: 90.0 }],
-  //     ];
-  //   },
-  //   // 添加排序
-  //   addOrderBy: {
-  //     // 排序字段及排序方式
-  //     price: 'desc',
-  //   },
-  },
-})
-export class NewsAdminCategoriesController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
-}

+ 0 - 64
cool-admin-midway-master/src/app/modules/news/controller/public/categories.ts

@@ -1,64 +0,0 @@
-import { Get, Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { NewsCategoriesEntity } from '../../entity/categories';
-
-/**
- * 商品
- */
-@Provide()
-@CoolController({
-  // 添加通用CRUD接口
-  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
-  // 设置表实体
-  entity: NewsCategoriesEntity,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
-  // // 分页查询配置
-  // pageQueryOp: {
-  //   // 让title字段支持模糊查询
-  //   keyWordLikeFields: ['title'],
-  //   // 让type字段支持筛选
-  //   fieldEq: ['type'],
-  //   // 指定返回字段
-  //   select: ['a.*', 'b.name'],
-  //   // 关联表用户表
-  //   leftJoin: [
-  //     {
-  //       // 管理的表
-  //       entity: BaseSysUserEntity,
-  //       // 别名
-  //       alias: 'b',
-  //       // 关联条件
-  //       condition: 'a.userId = b.id',
-  //     },
-  //   ],
-  //   // 增加其他条件
-  //   where: async (ctx: Context) => {
-  //     return [
-  //       // 价格大于90
-  //       ['a.price > :price', { price: 90.0 }],
-  //     ];
-  //   },
-  //   // 添加排序
-  //   addOrderBy: {
-  //     // 排序字段及排序方式
-  //     price: 'desc',
-  //   },
-  // },
-})
-export class NewsPublicCategoriesController extends BaseController {
-  /**
-   * 其他接口
-   */
-  @Get('/other')
-  async other() {
-    return this.ok('hello, cool-admin!!!');
-  }
-}

+ 0 - 53
cool-admin-midway-master/src/app/modules/news/entity/articles.ts

@@ -1,53 +0,0 @@
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 文章
- */
-@EntityModel('news-articles')
-export class NewsArticlesEntity extends BaseEntity {
-  @Column({ comment: '作者ID' })
-  user_id: number;
-
-  @Column({ comment: '分类id', nullable:true})
-  category_id: string;
-
-  @Column({ comment: '标题' })
-  title: string;
-
-  @Column({ comment: '文章内容', type: 'text' })
-  content: string;
-
-  @Column({ comment: '文章摘要', nullable:true })
-  excerpt: string;
-
-  @Column({
-      comment: '文章状态:0 草稿箱 1 已发布', 
-      default:0
-  })
-  article_status: boolean;
-
-  @Column({ comment: '阅读数量', default:0 })
-  view_count: number;
-
-  @Column({ comment: '喜欢数、点赞数', default:0 })
-  like_count: string;
-
-  @Column({ comment: '是否置顶', default:0 })
-  is_sticky: boolean;
-
-  @Column({ comment: '阅读加精', default:0 })
-  is_essence: boolean;
-
-  @Column({ comment: '评论状态:0 关闭 1 开放', default:0 })
-  comment_status: boolean;
-
-  @Column({ comment: '评论数量', default:0 })
-  comment_count: boolean;
-
-  @Column({ comment: '最后回复用户 id', nullable:true })
-  last_comment_user_id: number;
-
-
-}

+ 0 - 25
cool-admin-midway-master/src/app/modules/news/entity/categories.ts

@@ -1,25 +0,0 @@
-import { EntityModel } from '@midwayjs/orm';
-import { BaseEntity } from 'midwayjs-cool-core';
-import { Column } from 'typeorm';
-
-/**
- * 文章分类
- */
-@EntityModel('news-categories')
-export class NewsCategoriesEntity extends BaseEntity {
-  @Column({ comment: '类别名称' })
-  name: string;
-
-  @Column({ comment: '类别描述' })
-  description: string;
-
-  @Column({ comment: '类别图标地址' })
-  icon: string;
-
-  @Column({ comment: '类别显示顺序',nullable:true })
-  sort: number;
-
-  @Column({ comment: '该类别下文章数量',nullable:true })
-  article_count: number;
-
-}

+ 0 - 36
cool-admin-midway-master/src/app/modules/news/service/articles.ts

@@ -1,36 +0,0 @@
-import { Provide } from '@midwayjs/decorator';
-import { BaseService } from 'midwayjs-cool-core';
-import { InjectEntityModel } from '@midwayjs/orm';
-import { Repository } from 'typeorm';
-import { NewsArticlesEntity } from '../entity/articles';
-import { NewsCategoriesEntity } from '../entity/categories';
-
-/**
- * 系统用户
- */
-@Provide()
-export class NewsArticlesService extends BaseService {
-
-  @InjectEntityModel(NewsArticlesEntity)
-  NewsArticlesEntity: Repository<NewsArticlesEntity>;
-
-  @InjectEntityModel(NewsCategoriesEntity)
-  NewsCategoriesEntity:Repository<NewsCategoriesEntity>;
-  
-
-  /**
-   * 重载新增接口
-   */
-  async add(param) {
-    const { category_id } = param;
-    if(category_id){
-        const categories = await this.NewsCategoriesEntity.findOne(category_id);
-        categories.article_count = categories.article_count + 1;
-        await this.NewsCategoriesEntity.save(categories);
-    }
-
-    return super.add(param);
-  }
-
-  
-}

+ 16 - 32
cool-admin-midway-master/src/app/modules/hide/controller/admin/hide_game_account_record.ts

@@ -1,16 +1,14 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-23 15:45:46
- * @LastEditTime: 2022-04-21 17:10:13
+ * @LastEditTime: 2022-06-28 10:26:20
  * @Description: 
- * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\hide\controller\admin\hide_game_account_record.ts
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\data_23.ts
  */
 import { Provide } from '@midwayjs/decorator';
-// import { Context } from 'egg';
 import { CoolController, BaseController } from 'midwayjs-cool-core';
-// import { BaseSysUserEntity } from '../../../base/entity/sys/user';
-import { HideGameAccountRecordEntity } from '../../entity/hide_game_account_record';
-import { HideGameAccountRecordService } from '../../service/hide_game_account_record';
+import { ShuyouData23Entity } from '../../entity/data_23';
+import { ShuyouData23Service } from '../../service/data_23';
 
 /**
  * 商品
@@ -20,25 +18,17 @@ import { HideGameAccountRecordService } from '../../service/hide_game_account_re
   // 添加通用CRUD接口
   api: ['add', 'delete', 'update', 'info', 'list', 'page'],
   // 设置表实体
-  entity: HideGameAccountRecordEntity,
-  service: HideGameAccountRecordService,
-  // // 向表插入当前登录用户ID
-  // insertParam: async (ctx: Context) => {
-  //   return {
-  //     userId: ctx.admin.userId,
-  //   };
-  // },
-  // // info接口忽略价格字段
-  // infoIgnoreProperty: ['price'],
+  entity: ShuyouData23Entity,
+  service: ShuyouData23Service,
 
-  before: ctx => {
-    //前段数据转JSON格式
-    const data = ctx.request.body;
-    if (data.account_text == "") {
-      data.account_text = null
-    }
-    ctx.request.body.data = JSON.stringify(data);
-  },
+  // before: ctx => {
+  //   //前段数据转JSON格式
+  //   const data = ctx.request.body;
+  //   if (data.account_text == "") {
+  //     data.account_text = null
+  //   }
+  //   ctx.request.body.data = JSON.stringify(data);
+  // },
   // 分页查询配置
   // pageQueryOp: {
   //   // 让字段支持模糊查询
@@ -72,12 +62,6 @@ import { HideGameAccountRecordService } from '../../service/hide_game_account_re
   //   },
   // },
 })
-export class HideGameAccountRecordController extends BaseController {
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
+export class ShuyouData23Controller extends BaseController {
+
 }

+ 89 - 0
cool-admin-midway-master/src/app/modules/shuyou/controller/admin/data_abnormal_rate.ts

@@ -0,0 +1,89 @@
+/*
+ * @Author: YKH
+ * @Date: 2021-12-10 09:04:02
+ * @LastEditTime: 2022-06-14 11:56:58
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\data_abnormal_rate.ts
+ */
+import { Provide, Inject, Post, Body, ALL } from '@midwayjs/decorator';
+import { CoolController, BaseController } from 'midwayjs-cool-core';
+import { ShuyouAbnormalRateEntity } from '../../entity/data_abnormal_rate';
+import { ShuyouAbnormalRateService } from '../../service/data_abnormal_rate';
+
+/**
+ * 游戏负责人
+ */
+@Provide()
+@CoolController({
+  // 添加通用CRUD接口
+  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+  // 设置表实体
+  entity: ShuyouAbnormalRateEntity,
+  service: ShuyouAbnormalRateService,
+
+  before: ctx => {
+    //前段数据转JSON格式
+    const data = ctx.request.body;
+    // console.log(data.agentOrDirector)
+    if (typeof (data.new_date) == "undefined") {
+      data.new_date = [new Date(), new Date()]
+    }
+    ctx.request.body.data = JSON.stringify(data);
+  },
+  // 分页查询配置
+  // pageQueryOp: {
+  //   // 让字段支持模糊查询
+  //   keyWordLikeFields: ['directorName'],
+  //   // 让字段支持筛选
+  //   fieldEq: ['directorName'],
+  //   // 添加排序
+  //   addOrderBy: {
+  //     // 排序字段及排序方式
+  //     id: 'desc',
+  //   },
+  // },
+})
+export class ShuyouAbnormalRateController extends BaseController {
+
+  @Inject()
+  ShuyouAbnormalRateService: ShuyouAbnormalRateService;
+
+  @Post('/queryAbnormalRate')
+  async queryAbnormalRate(@Body(ALL) queryObject: any) {
+    let { date } = queryObject
+    if (typeof (date) == "undefined") {
+      date = [new Date(), new Date()]
+    }
+    let queryAbnormalRate = await this.ShuyouAbnormalRateService.queryAbnormalRate(date);
+    // console.log(queryAbnormalRate)
+    if (!queryAbnormalRate) {
+      return { code: -1, message: '未查询到数据' };
+    }
+    return await this.ok({ code: 1, data: queryAbnormalRate });
+  }
+
+  @Post('/querySeven')
+  async querySeven(@Body(ALL) queryObject: any) {
+    let { task_id, new_date } = queryObject
+    let queryAbnormalRate = await this.ShuyouAbnormalRateService.querySeven(task_id, new_date);
+    // console.log(queryAbnormalRate)
+    if (!queryAbnormalRate) {
+      return { code: -1, message: '未查询到数据' };
+    }
+    return await this.ok({ code: 1, data: queryAbnormalRate });
+  }
+
+  @Post('/querySomeTime')
+  async querySomeTime(@Body(ALL) queryObject: any) {
+    let { task_id, new_date } = queryObject
+    if (typeof (new_date) == "undefined") {
+      new_date = [new Date().getTime() - 3600 * 1000 * 24 * 1, new Date().getTime() - 3600 * 1000 * 24 * 1]
+    }
+    let queryAbnormalRate = await this.ShuyouAbnormalRateService.querySomeTime(task_id, new_date);
+    // console.log(queryAbnormalRate)
+    if (!queryAbnormalRate) {
+      return { code: -1, message: '未查询到数据' };
+    }
+    return await this.ok({ code: 1, data: queryAbnormalRate });
+  }
+}

+ 29 - 2
cool-admin-midway-master/src/app/modules/shuyou/controller/admin/data_active.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-10 09:04:02
- * @LastEditTime: 2022-04-15 09:55:33
+ * @LastEditTime: 2022-06-07 11:02:09
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\data_active.ts
  */
@@ -148,6 +148,28 @@ export class ShuyouDataActiveController extends BaseController {
     }
     return await this.ok({ code: 1, data: ipCount });
   }
+
+  /**
+   *
+   *异常统计-根据负责人和未完成原因
+   * @param {*} queryObject
+   * @return {*} 
+   * @memberof ShuyouDataActiveController
+   */
+  @Post('/queryAbnormalStatisticsByDirectorReason')
+  async queryAbnormalStatisticsByDirectorReason(@Body(ALL) queryObject: any) {
+    // console.log('异常统计-根据负责人和未完成原因')
+    let { date } = queryObject
+    if (typeof (date) == "undefined") {
+      date = [new Date(), new Date()]
+    }
+    let queryAbnormalStatisticsByDirectorReason = await this.ShuyouDataActiveService.queryAbnormalStatisticsByDirectorReason(date);
+    // console.log(queryAbnormalStatisticsByDirectorReason)
+    if (!queryAbnormalStatisticsByDirectorReason) {
+      return { code: -1, message: '未查询到数据' };
+    }
+    return await this.ok({ code: 1, data1: queryAbnormalStatisticsByDirectorReason });
+  }
   //
   @Post('/queryGameCountByDirectorGameAgent')
   async queryGameCountByDirectorGameAgent(@Body(ALL) queryObject: any) {
@@ -170,7 +192,12 @@ export class ShuyouDataActiveController extends BaseController {
     if (!queryGameCountByGameAgent) {
       return { code: -1, message: '未查询到数据' };
     }
-    return await this.ok({ code: 1, data1: queryGameCountByDirectorGameAgent, data2: queryGameCountByDirector, data3: queryGameCountByGameAgent });
+    let queryGameCountByDirectorReal = await this.ShuyouDataActiveService.queryGameCountByDirectorReal(date);
+    // console.log(queryGameCountByGameAgent)
+    if (!queryGameCountByDirectorReal) {
+      return { code: -1, message: '未查询到数据' };
+    }
+    return await this.ok({ code: 1, data1: queryGameCountByDirectorGameAgent, data2: queryGameCountByDirector, data3: queryGameCountByGameAgent, data4: queryGameCountByDirectorReal });
   }
   /**
    *查询今日游戏付费top5

+ 73 - 11
cool-admin-midway-master/src/app/modules/shuyou/controller/admin/game_target.ts

@@ -1,14 +1,16 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2021-12-21 17:31:35
+ * @LastEditTime: 2022-07-05 13:43:30
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\game_target.ts
  */
-import { Provide } from '@midwayjs/decorator';
+import { ALL, Body, Inject, Post, Provide } from '@midwayjs/decorator';
 import { CoolController, BaseController } from 'midwayjs-cool-core';
 import { ShuyouGameTargetEntity } from '../../entity/game_target';
 import { ShuyouGameTargetService } from '../../service/game_target';
+import { ShuyouXJFUtilsService } from '../../service/utils_xjf';
+
 
 /**
  * 游戏目标
@@ -52,14 +54,74 @@ import { ShuyouGameTargetService } from '../../service/game_target';
 })
 export class ShuyouGameTargetController extends BaseController {
 
-  // @Inject()
-  // ShuyouGameTaskService: ShuyouGameTaskService;
+  @Inject()
+  ShuyouGameTargetService: ShuyouGameTargetService;
+
+  @Inject()
+  ShuyouXJFUtilsService: ShuyouXJFUtilsService;
+
+
+  //重新下发今日付费未成功的账号以及重置留存账号
+  @Post('/resetPay')
+  async resetPay(@Body(ALL) queryObject) {
+    let { id } = queryObject
+    // console.log(id)
+    let reqmsg = await this.ShuyouGameTargetService.resetPay(id);
+    // console.log(reqmsg)
+    if (reqmsg.code == 1000) {
+      return this.ok({ code: 1, message: '重置成功' });
+    } else {
+      return this.fail(reqmsg.data + '', -1);
+    }
+  }
+  //手动充值-魅族
+  @Post('/handAddPayMz')
+  async handAddPayMz(@Body(ALL) queryObject) {
+    let { xjf_id, pay_price, account } = queryObject
+    // console.log(xjf_id)
+    // console.log('pay_price' + pay_price)
+    if (xjf_id == 0) {
+      return this.fail('机房后台不存在此任务', -1);
+    }
+    let list
+    list = await this.ShuyouXJFUtilsService.handAddPayMz(xjf_id, account, pay_price);
+    console.log(list)
+    if (list.code == 1) {
+      if (list.data == 'Get http://127.0.0.1:6655/once_max_recharge: EOF') {
+        return this.ok({ code: 1, message: '喵币不足,请联系商务添加' });
+      } else if (list.data == '没有传加币金额') {
+        return this.ok({ code: 1, message: '加币金额只能为正整数' });
+      } else {
+        return this.ok({ code: 1, message: list.data });
+      }
+    } else {
+      return this.fail('无法获取信息', -1);
+    }
+  }
+
+  //强制手动充值-魅族
+  @Post('/forceAddPayMz')
+  async forceAddPayMz(@Body(ALL) queryObject) {
+    let { xjf_id, pay_price, account } = queryObject
+    // console.log(xjf_id)
+    // console.log('pay_price' + pay_price)
+    if (xjf_id == 0) {
+      return this.fail('机房后台不存在此任务', -1);
+    }
+    let list
+    list = await this.ShuyouXJFUtilsService.forceAddPayMz(xjf_id, account, pay_price);
+    console.log(list)
+    if (list.code == 1) {
+      if (list.data == 'Get http://127.0.0.1:6655/once_max_recharge: EOF') {
+        return this.ok({ code: 1, message: '喵币不足,请联系商务添加' });
+      } else if (list.data == '没有传加币金额') {
+        return this.ok({ code: 1, message: '加币金额只能为正整数' });
+      } else {
+        return this.ok({ code: 1, message: list.data });
+      }
+    } else {
+      return this.fail('无法获取信息', -1);
+    }
+  }
 
-  /**
-   * 其他接口
-   */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
 }

+ 50 - 0
cool-admin-midway-master/src/app/modules/shuyou/controller/admin/robot_enterprise_wechat.ts

@@ -0,0 +1,50 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-04-14 11:46:16
+ * @LastEditTime: 2022-06-14 15:41:49
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\robot_enterprise_wechat.ts
+ */
+import { Provide } from '@midwayjs/decorator';
+import { CoolController, BaseController } from 'midwayjs-cool-core';
+import { SyRobotEnterpriseWeChatEntity } from '../../entity/robot_enterprise_wechat';
+import { SyRobotEnterpriseWeChatService } from '../../service/robot_enterprise_wechat';
+
+/**
+ * 
+ */
+@Provide()
+@CoolController({
+  // 添加通用CRUD接口
+  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+  // 设置表实体
+  entity: SyRobotEnterpriseWeChatEntity,
+  service: SyRobotEnterpriseWeChatService,
+
+  before: ctx => {
+    //前段数据转JSON格式
+    // const data = ctx.request.body;
+    // console.log(data)
+    // console.log(data.status)
+    // if (data.status == "") {
+    //   data.status = 1
+    // }
+    // // console.log(data.status)
+    // ctx.request.body.data = JSON.stringify(data);
+  },
+  // 分页查询配置
+  pageQueryOp: {
+    // 让字段支持模糊查询
+    keyWordLikeFields: ['name'],
+    // 让字段支持筛选
+    fieldEq: ['name'],
+    // 添加排序
+    addOrderBy: {
+      // 排序字段及排序方式
+      name: 'asc',
+    },
+  },
+})
+export class SyRobotEnterpriseWeChatController extends BaseController {
+
+}

+ 52 - 7
cool-admin-midway-master/src/app/modules/shuyou/controller/admin/utils.ts

@@ -1,14 +1,15 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-11 21:34:38
- * @LastEditTime: 2021-12-12 20:48:14
+ * @LastEditTime: 2022-06-27 16:36:43
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\utils.ts
  */
-import { Get, Inject, Provide } from '@midwayjs/decorator';
+import { ALL, Body, Get, Inject, Post, Provide } from '@midwayjs/decorator';
 import { ILogger } from '@midwayjs/logger';
 import { BaseController, CoolController } from 'midwayjs-cool-core';
 import { ShuyouUtilsService } from '../../service/utils';
+import { ShuyouXJFUtilsService } from '../../service/utils_xjf';
 
 
 @Provide()
@@ -18,6 +19,9 @@ export class ShuyouAdminUtilsController extends BaseController {
   ShuyouUtilsService: ShuyouUtilsService;
 
   @Inject()
+  ShuyouXJFUtilsService: ShuyouXJFUtilsService;
+
+  @Inject()
   logger: ILogger;
 
   /**
@@ -35,12 +39,53 @@ export class ShuyouAdminUtilsController extends BaseController {
       return this.fail('无法获取天气信息', -1);
     }
   }
+
+
+  //TODO
   /**
-   * 其他接口
+   *查询当前付费失败的账号
+   *
+   * @return {*} 
+   * @memberof ShuyouAdminUtilsController
    */
-  // @Get('/other')
-  // async other() {
-  //   return this.ok('hello, cool-admin!!!');
-  // }
+  @Post('/payFailed')
+  async payFailed(@Body(ALL) queryObject) {
+    const { task_id } = queryObject;
+    let list
+    list = await this.ShuyouXJFUtilsService.payFailed(task_id);
+    if (list.code == 1) {
+      if (list.data == 'null') {
+        return this.ok({ code: 1, message: 'null' });
+      } else {
+        return this.ok({ code: 1, message: JSON.parse(list.data) });
+      }
+    } else {
+      return this.fail('无法获取信息', -1);
+    }
+  }
+  /**
+     *查询今日可付费账号
+     *
+     * @return {*} 
+     * @memberof ShuyouAdminUtilsController
+     */
+  @Post('/unpaid')
+  async unpaid(@Body(ALL) queryObject) {
+    const { task_id } = queryObject;
+    let list
+    list = await this.ShuyouXJFUtilsService.unpaid(task_id);
+    if (list.code == 1) {
+      if (list.data == 'null') {
+        return this.ok({ code: 1, message: 'null' });
+      } else {
+        return this.ok({ code: 1, message: JSON.parse(list.data) });
+      }
+    } else {
+      return this.fail('无法获取信息', -1);
+    }
+  }
+
+
+
 
 }

+ 5 - 3
cool-admin-midway-master/src/app/modules/shuyou/controller/app/game_task.ts

@@ -56,8 +56,8 @@ export class ShuyouAppGameTaskController extends BaseController {
   @Inject()
   ShuyouFileListService: ShuyouFileListService;
 
-  /**
-   * http://127.0.0.1:8001/app/shuyou/game_task/getTaskTAndC?task_id=3520&new_date=2022-02-16
+  /**http://ykhvip.fun/api/app/shuyou/game_task/getTaskTAndC?new_date=2022-05-31
+   * http://127.0.0.1:8001/app/shuyou/game_task/getTaskTAndC?task_id=3520&new_date=2022-05-16
    * //获取游戏目标与完成{task_id,new_date}
    * @param {*} queryObject
    * @memberof ShuyouAppGameTaskController
@@ -107,8 +107,10 @@ export class ShuyouAppGameTaskController extends BaseController {
           complete_pay: parseInt(e.complete_pay),
           complete_active: parseInt(e.complete_active),
           xmy_id: e.xmy_id,
-          qq_channel: e.qq_channel,
           qq_id: e.qq_id,
+          qq_channel: e.qq_channel,
+          mz_id: e.mz_id,
+          mz_channel: e.mz_channel,
           game_rate: e.game_rate,  //群控效率
           game_rate_xmy: e.game_rate_xmy,  //小绵羊后台效率
           is_complete: e.is_complete,  //是否完成

+ 1 - 1
cool-admin-midway-master/src/app/modules/shuyou/controller/app/idcard.ts

@@ -9,7 +9,7 @@ import * as _ from 'lodash';
 
 
 /**同一渠道身份证最大使用次数 **/
-const repeatTime = 20
+const repeatTime = 200
 
 
 /**

+ 48 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/data_23.ts

@@ -0,0 +1,48 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-06-27 17:31:14
+ * @LastEditTime: 2022-06-27 18:20:55
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\data_23.ts
+ */
+import { EntityModel } from '@midwayjs/orm';
+import { Column, Index } from 'typeorm';
+import { BaseEntity } from 'midwayjs-cool-core';
+/**
+ * 记录23点以后有付费的游戏
+ */
+@EntityModel('shuyou_data_23')
+@Index(["task_id", "new_date"], { unique: true }) // 联合索引
+export class ShuyouData23Entity extends BaseEntity {
+
+  @Index()
+  @Column({ comment: '任务id' })
+  task_id: string;
+
+  @Index()
+  @Column({ comment: '任务名', length: 100 })
+  task_name: string;
+
+  @Column({ comment: '负责人id' })
+  directorId: number;
+
+  @Index()
+  @Column({ type: 'date', comment: '目标日期' })
+  new_date: Date;
+
+  @Column({ comment: '未完成新增', default: 0 })
+  incomplete_new: number;
+
+  @Column({ comment: '未完成付费', default: 0 })
+  incomplete_pay: number;
+
+  @Column({ comment: '未完成活跃', default: 0 })
+  incomplete_active: number;
+
+  @Column({ comment: '创建时间' })
+  createTime: Date;
+
+  @Column({ comment: '更新时间' })
+  updateTime: Date;
+
+}

+ 86 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/data_abnormal_rate.ts

@@ -0,0 +1,86 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-06-08 10:20:29
+ * @LastEditTime: 2022-06-09 17:24:28
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\data_abnormal_rate.ts
+ */
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from 'midwayjs-cool-core';
+import { Column, Index } from 'typeorm';
+
+/**
+ * data_abnormal_rate游戏异常率
+ */
+@EntityModel('data_abnormal_rate')
+@Index(["task_id", "new_date", "hour"], { unique: true }) // 联合索引
+export class ShuyouAbnormalRateEntity extends BaseEntity {
+
+    @Index()
+    @Column({ comment: '任务id' })
+    task_id: string;
+
+    @Index()
+    @Column({ comment: '任务名', length: 100 })
+    task_name: string;
+
+    @Column({ comment: '负责人id' })
+    directorId: number;
+
+    @Index()
+    @Column({ type: 'date', comment: '目标日期' })
+    new_date: Date;
+
+    @Column({ comment: '小时', default: 1 })
+    hour: number;
+
+    @Column({ comment: '游戏封号数', default: 0 })
+    num_frozen: number;
+
+    @Column({ comment: '拉取账号数', default: 0 })
+    num_pull_account: number;
+
+    @Column({ comment: '启动模拟器成功数', default: 0 })
+    num_start_simulator: number;
+
+    @Column({ comment: '上传Ip', default: 0 })
+    num_ip: number;
+
+    @Column({ comment: '脚本启动成功数', default: 0 })
+    num_start_script: number;
+
+    @Column({ comment: '游戏启动成功数', default: 0 })
+    num_start_game: number;
+
+    @Column({ comment: '账号登陆成功数', default: 0 })
+    num_login_success: number;
+
+    @Column({ comment: '进入游戏成功数', default: 0 })
+    num_into_game: number;
+
+    @Column({ comment: '新增成功', default: 0 })
+    num_new_success: number;
+
+    @Column({ comment: '留存成功', default: 0 })
+    num_lc_success: number;
+
+    @Column({ comment: '付费成功', default: 0 })
+    num_pay_success: number;
+
+    @Column({ type: "double", comment: '完整率', default: 0.00, scale: 2 })
+    rate_all_step: number;
+
+    @Column({ comment: '下发付费账号', default: 0 })
+    num_pull_pay: number;
+
+    @Column({ comment: '留存账号总数', default: 0 })
+    num_account_lc: number;
+
+    @Column({ comment: '可以付费的账号', default: 0 })
+    num_could_pay: number;
+
+    @Column({ comment: '订单数/付费成功数/成功率', default: '0/0/0%' })
+    order_success_rate: string;
+
+
+}

+ 69 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/game_complete_hand.ts

@@ -0,0 +1,69 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-05-26 09:26:34
+ * @LastEditTime: 2022-07-05 11:53:39
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\game_complete_hand.ts
+ */
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from 'midwayjs-cool-core';
+import { Column, Index } from 'typeorm';
+
+/**
+ * 手动完成记录表
+ */
+@EntityModel('shuyou_game_complete_hand')
+@Index(["task_id", "new_date"], { unique: true }) // 联合索引
+export class ShuyouGameCompleteHandEntity extends BaseEntity {
+
+  @Index()
+  @Column({ comment: '任务id' })
+  task_id: string;
+
+  // @Index()
+  // @Column({ comment: '任务名', length: 100 })
+  // task_name: string;
+
+  @Index()
+  @Column({ type: 'date', comment: '完成日期' })
+  new_date: Date;
+
+  @Column({ comment: '新增个数', default: 0 })
+  complete_new_hand: number;
+
+  @Column({ comment: '留存个数', default: 0 })
+  complete_lc_hand: number;
+
+  @Column({ comment: '有无付费 0有付费 1无付费', default: 1, type: 'tinyint' })
+  is_pay_hand: number;
+
+  @Column({ comment: '付费个数', default: 0 })
+  complete_pay_hand: number;
+
+  @Column({ comment: '付费单价', type: 'decimal', default: 0.00, scale: 2 })
+  price_hand: number;
+
+  @Column({ comment: '付费流水', type: 'decimal', default: 0.00, scale: 2 })
+  amount_hand: number;
+
+  @Column({ comment: '支付方式 0QQ卡 1微信 2支付宝 3银行卡 4其他方式', default: 4, type: 'tinyint' })
+  pay_mode_hand: number;
+
+  @Column({ comment: '其他支付方式', nullable: true })
+  other_pay_hand: string;
+
+  @Column({ comment: '单价一致 0一致 1不一致', default: 0, type: 'tinyint' })
+  is_same_hand: number;
+
+  @Column({ comment: '相关账号', type: 'text', nullable: true })
+  account_hand: string;
+
+  @Column({ comment: '上传WT 0不上传 1上传', default: 0, type: 'tinyint' })
+  is_wt_hand: number;
+
+  @Column({ comment: '上传xjf 0不上传 1上传', default: 0, type: 'tinyint' })
+  is_xjf_hand: number;
+
+  card_list: [];
+
+}

+ 32 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/game_complete_hand_card.ts

@@ -0,0 +1,32 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-05-26 09:26:34
+ * @LastEditTime: 2022-07-05 16:11:44
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\game_complete_hand_card.ts
+ */
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from 'midwayjs-cool-core';
+import { Column, Index } from 'typeorm';
+
+/**
+ * 手动用QQ卡记录表
+ */
+@EntityModel('shuyou_game_complete_hand_card')
+export class ShuyouGameCompleteHandCardEntity extends BaseEntity {
+
+  @Index()
+  @Column({ comment: '任务id' })
+  task_id: string;
+
+  @Index()
+  @Column({ type: 'date', comment: '完成日期' })
+  new_date: Date;
+
+  @Column({ comment: 'QQ卡号' })
+  card_account: string;
+
+  @Column({ comment: '消耗金额' })
+  card_balance: string;
+
+}

+ 6 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/game_task.ts

@@ -132,4 +132,10 @@ export class ShuyouGameTaskEntity {
   @Column({ comment: '下载链接', nullable: true })
   download: string;
 
+  @Column({ comment: '新增付费or留存付费 1:重做新增付费 2:重做留存付费', default: 2, type: 'tinyint' })
+  new_retained: number;
+
+  @Column({ comment: '机房后台game_id', default: 0 })
+  xjf_id: number;
+
 }

+ 31 - 0
cool-admin-midway-master/src/app/modules/shuyou/entity/robot_enterprise_wechat.ts

@@ -0,0 +1,31 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-04-14 11:33:31
+ * @LastEditTime: 2022-06-14 15:05:07
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\robot_enterprise_wechat.ts
+ */
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from 'midwayjs-cool-core';
+import { Column } from 'typeorm';
+
+/**
+ * 企业微信机器人Webhook地址记录
+ */
+@EntityModel('robot_enterprise_wechat')
+export class SyRobotEnterpriseWeChatEntity extends BaseEntity {
+
+  @Column({ comment: '企业微信群名称', length: 100 })
+  name: string;
+
+  @Column({ comment: '描述', nullable: true, length: 200 })
+  description: string;
+
+  @Column({ comment: 'Webhook地址' })
+  webhook: string;
+
+  @Column({ comment: '状态 0:禁用 1:启用', default: 1, type: 'tinyint' })
+  status: number;
+
+}
+

+ 49 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/data_23.ts

@@ -0,0 +1,49 @@
+/*
+ * @Author: YKH
+ * @Date: 2021-12-08 10:26:27
+ * @LastEditTime: 2022-06-28 11:29:40
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\data_23.ts
+ */
+import { Inject, Provide } from '@midwayjs/decorator';
+import { BaseService } from 'midwayjs-cool-core';
+import { InjectEntityModel } from '@midwayjs/orm';
+import { Repository } from 'typeorm';
+import * as _ from 'lodash';
+import { ShuyouData23Entity } from '../entity/data_23';
+import { Utils } from '../../../comm/utils';
+
+/**
+ * 游戏目标
+ */
+@Provide()
+export class ShuyouData23Service extends BaseService {
+
+  @InjectEntityModel(ShuyouData23Entity)
+  ShuyouData23Entity: Repository<ShuyouData23Entity>;
+
+  @Inject()
+  utils: Utils;
+  /**
+  * 重写list查询
+  * @param query
+  */
+  async list(query) {
+    const { date } = query;
+    // console.log(date)
+    const sql = `
+          SELECT
+            a.*,
+            b.name as director_name
+          FROM
+            shuyou_data_23 a
+            LEFT JOIN shuyou_game_director b ON a.directorId = b.id 
+          WHERE 1 = 1
+            and incomplete_pay > 0
+            ${this.setSql(date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(date[0])), this.utils.formatDate(new Date(date[1]))])}
+        `;
+    return this.nativeQuery(sql);
+  }
+
+
+}

+ 116 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/data_abnormal_rate.ts

@@ -0,0 +1,116 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-06-08 15:37:04
+ * @LastEditTime: 2022-06-28 14:19:50
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\data_abnormal_rate.ts
+ */
+import { Inject, Provide } from '@midwayjs/decorator';
+import { BaseService } from 'midwayjs-cool-core';
+import * as _ from 'lodash';
+import { Utils } from '../../../comm/utils';
+
+/**
+ * 游戏目标
+ */
+@Provide()
+export class ShuyouAbnormalRateService extends BaseService {
+
+
+  @Inject()
+  utils: Utils;
+
+  async queryAbnormalRate(new_date: Date) {
+    let sql = ``
+    if (this.utils.formatDate(new Date()) == this.utils.formatDate(new Date(new_date))) { //当天数据处理
+      let hour = new Date().getHours()
+      if (new Date().getMinutes() <= 30) {
+        hour = hour - 1
+      }
+      sql = `
+      SELECT
+        a.task_id,a.task_name,a.new_date,a.num_frozen,a.num_pull_account,a.num_start_simulator,a.num_ip,a.num_start_script,a.num_start_game,
+        a.num_login_success,a.num_into_game,a.num_new_success,a.num_lc_success,a.num_pay_success,a.rate_all_step,a.num_pull_pay,
+        a.num_account_lc,a.num_could_pay,a.order_success_rate,
+        b.name as director_name
+      FROM
+        data_abnormal_rate a
+        LEFT JOIN shuyou_game_director b ON a.directorId = b.id 
+      WHERE
+        1 = 1
+        ${this.setSql(hour, 'and hour = ?', hour)}
+        ${this.setSql(new_date, 'and new_date = ?', this.utils.formatDate(new Date(new_date)))}
+      ORDER BY task_id
+      `;
+    } else {
+      sql = `
+      SELECT
+      a.task_id,a.task_name,a.new_date,a.num_frozen,a.num_pull_account,a.num_start_simulator,a.num_ip,a.num_start_script,a.num_start_game,
+      a.num_login_success,a.num_into_game,a.num_new_success,a.num_lc_success,a.num_pay_success,a.rate_all_step,a.num_pull_pay,
+      a.num_account_lc,a.num_could_pay,a.order_success_rate,
+      b.name as director_name
+      FROM
+        data_abnormal_rate a
+        LEFT JOIN shuyou_game_director b ON a.directorId = b.id 
+      WHERE
+        1 = 1
+        and hour = 23
+        ${this.setSql(new_date, 'and new_date = ?', this.utils.formatDate(new Date(new_date)))}
+      ORDER BY task_id
+      `;
+    }
+
+    return await this.nativeQuery(sql);
+  }
+  //查询七天数据
+  async querySeven(task_id: string, new_date: Date) {
+    //计算时间段
+    let new_date2 = this.utils.getNextDate(new_date, -7)
+
+    if (this.utils.formatDate(new Date()) == this.utils.formatDate(new Date(new_date))) { //今日数据因为不准确所以不查询
+      new_date = new Date(this.utils.getNextDate(new_date, -1))
+    }
+    let sql = `
+      SELECT
+      a.task_id,a.task_name,a.new_date,a.num_frozen,a.num_pull_account,a.num_start_simulator,a.num_ip,a.num_start_script,a.num_start_game,
+      a.num_login_success,a.num_into_game,a.num_new_success,a.num_lc_success,a.num_pay_success,a.rate_all_step,a.num_pull_pay,
+      a.num_account_lc,a.num_could_pay,a.order_success_rate,
+      b.name as director_name
+      FROM
+        data_abnormal_rate a
+        LEFT JOIN shuyou_game_director b ON a.directorId = b.id 
+      WHERE
+        1 = 1
+        and hour = 23
+        ${this.setSql(task_id, 'and task_id = ?', task_id)}
+        ${this.setSql(new_date, 'and new_date >= ? and new_date <= ?', [this.utils.formatDate(new Date(new_date2)), this.utils.formatDate(new Date(new_date))])}
+      ORDER BY task_id,a.new_date
+      `;
+    return await this.nativeQuery(sql);
+  }
+  //查询一段时间数据
+  async querySomeTime(task_id: string, new_date: Date[]) {
+
+    if (this.utils.formatDate(new Date()) == this.utils.formatDate(new Date(new_date[1]))) { //今日数据因为不准确所以不查询
+      new_date[1] = new Date(this.utils.getNextDate(new_date[1], -1))
+    }
+    let sql = `
+      SELECT
+      a.task_id,a.task_name,a.new_date,a.num_frozen,a.num_pull_account,a.num_start_simulator,a.num_ip,a.num_start_script,a.num_start_game,
+      a.num_login_success,a.num_into_game,a.num_new_success,a.num_lc_success,a.num_pay_success,a.rate_all_step,a.num_pull_pay,
+      a.num_account_lc,a.num_could_pay,a.order_success_rate,
+      b.name as director_name
+      FROM
+        data_abnormal_rate a
+        LEFT JOIN shuyou_game_director b ON a.directorId = b.id 
+      WHERE
+        1 = 1
+        and hour = 23
+        ${this.setSql(task_id, 'and task_id = ?', task_id)}
+        ${this.setSql(new_date, 'and new_date >= ? and new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
+      ORDER BY task_id,a.new_date
+      `;
+    return await this.nativeQuery(sql);
+  }
+
+}

+ 68 - 5
cool-admin-midway-master/src/app/modules/shuyou/service/data_active.ts

@@ -154,7 +154,7 @@ export class ShuyouDataActiveService extends BaseService {
         FROM
           shuyou_data_active
         WHERE
-          1 = 1
+          game_director = '合计' and game_agent = '合计'
           ${this.setSql(year, 'and YEAR(new_date) = ?', [year])}
           GROUP BY mon
         `;
@@ -193,6 +193,32 @@ export class ShuyouDataActiveService extends BaseService {
         `;
     return await this.nativeQuery(sql);
   }
+
+  /**
+   *
+   * 异常统计-根据负责人和未完成原因
+   * @param {Array<Date>} new_date
+   * @return {*} 
+   * @memberof ShuyouDataActiveService
+   */
+  async queryAbnormalStatisticsByDirectorReason(new_date: Array<Date>) {
+    const sql = `
+          SELECT
+            a.directorName,
+            IFNULL(b.name,'未填写') as type_name,
+            count( a.type_id ) game_count 
+          FROM
+            shuyou_reason_incomplete a
+            LEFT JOIN shuyou_problem_type b ON a.type_id = b.id
+          WHERE
+            1 = 1 
+            ${this.setSql(new_date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
+          GROUP BY
+            a.directorName,
+            b.name
+          `;
+    return await this.nativeQuery(sql);
+  }
   /**
    *  
    * @param {Array<Date>} new_date
@@ -232,14 +258,16 @@ export class ShuyouDataActiveService extends BaseService {
           c.NAME as game_director,
           sum( CASE a.complete_new WHEN 0 THEN 0 ELSE 1 END ) new_count,
           sum( CASE a.complete_pay WHEN 0 THEN 0 ELSE 1 END ) pay_count,
-          sum( CASE a.complete_active-a.complete_new WHEN 0 THEN 0 ELSE 1 END ) lc_count,
+          sum( CASE a.complete_new WHEN 0 THEN 1 ELSE 0 END ) lc_count,
+          count(a.task_id ) active_count,
           count(DISTINCT(a.task_id)) game_count
         FROM
           shuyou_game_complete a
-          LEFT JOIN shuyou_game_task b ON a.task_id = b.id
+          LEFT JOIN shuyou_game_target b ON a.task_id = b.task_id and a.new_date = b.new_date
           LEFT JOIN shuyou_game_director c ON b.directorId = c.id 
         WHERE
           1 = 1
+          AND b.directorId > 0
           ${this.setSql(new_date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
         GROUP BY
           b.directorId
@@ -253,17 +281,52 @@ export class ShuyouDataActiveService extends BaseService {
    * @return {*} 
    * @memberof ShuyouDataActiveService
    */
+  async queryGameCountByDirectorReal(new_date: Array<Date>) {
+    // count(DISTINCT(a.task_id)) '按渠道分',
+    //   count(DISTINCT l.game_name, l.game_agentId) '按端口分',
+    //     count(DISTINCT(l.game_name)) '按游戏分'
+    const sql = `
+        SELECT
+          c.NAME AS game_director,
+          l.game_name,
+          count(DISTINCT ( a.task_id )) count_qudao,
+          count(DISTINCT l.game_name, l.game_agentId) count_duankou,
+          count(DISTINCT (l.game_name)) count_game
+        FROM
+          shuyou_game_complete a
+          LEFT JOIN shuyou_game_target b ON a.task_id = b.task_id 
+          AND a.new_date = b.new_date
+          LEFT JOIN shuyou_game_director c ON b.directorId = c.id
+          LEFT JOIN task_game_record r ON r.task_id = a.task_id
+          LEFT JOIN shuyou_game_list l ON l.id = r.game_id 
+        WHERE
+          1 = 1 
+          AND b.directorId > 0 
+          ${this.setSql(new_date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
+        GROUP BY
+          b.directorId,l.game_name
+        ORDER 
+          BY b.directorId
+        `;
+    return await this.nativeQuery(sql);
+  }
+  /**
+   *  
+   * @param {Array<Date>} new_date
+   * @return {*} 
+   * @memberof ShuyouDataActiveService
+   */
   async queryGameCountByGameAgent(new_date: Array<Date>) {
     const sql = `
         SELECT
           c.NAME as game_agent,
           sum( CASE a.target_new WHEN 0 THEN 0 ELSE 1 END ) target_new_count,
           sum( CASE a.target_pay WHEN 0 THEN 0 ELSE 1 END ) target_pay_count,
-          sum( CASE a.target_active-a.target_new WHEN 0 THEN 0 ELSE 1 END ) target_lc_count,
+          sum( CASE a.target_new WHEN 0 THEN 1 ELSE 0 END ) target_lc_count,
           count(DISTINCT(a.task_id)) target_active_count,
           sum( CASE b.complete_new WHEN 0 THEN 0 ELSE 1 END ) complete_new_count,
           sum( CASE b.complete_pay WHEN 0 THEN 0 ELSE 1 END ) complete_pay_count,
-          sum( CASE b.complete_active-b.complete_new WHEN 0 THEN 0 ELSE 1 END ) complete_lc_count,
+          sum( CASE b.complete_new WHEN 0 THEN 1 ELSE 0 END ) complete_lc_count,
           count(DISTINCT(b.task_id)) complete_active_count
         FROM
           shuyou_game_target a

+ 130 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/game_complete_hand.ts

@@ -0,0 +1,130 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-05-27 09:01:24
+ * @LastEditTime: 2022-07-07 14:53:14
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\game_complete_hand.ts
+ */
+import { Inject, Provide } from '@midwayjs/decorator';
+import { BaseService } from 'midwayjs-cool-core';
+import { InjectEntityModel } from '@midwayjs/orm';
+import { Repository } from 'typeorm';
+import * as _ from 'lodash';
+import { ShuyouGameCompleteHandEntity } from '../entity/game_complete_hand';
+import { ILogger } from '@midwayjs/logger';
+import { Utils } from '../../../comm/utils';
+/**
+ * 手动完成处理
+ */
+@Provide()
+export class ShuyouGameCompleteHandService extends BaseService {
+
+  @InjectEntityModel(ShuyouGameCompleteHandEntity)
+  ShuyouGameCompleteHandEntity: Repository<ShuyouGameCompleteHandEntity>;
+
+  @Inject()
+  logger: ILogger;
+
+  @Inject()
+  utils: Utils;
+
+  /**
+  * 重载接口,修改或新增
+  */
+  async addOrUpdate(param) {
+    // console.log(param)
+    if (typeof (param.price_hand) == "undefined" || param.price_hand == 'null' || param.price_hand == null) {
+      param.price_hand = 0
+    }
+    if (typeof (param.amount_hand) == "undefined" || param.amount_hand == 'null' || param.amount_hand == null) {
+      param.amount_hand = 0
+    }
+    if (typeof (param.complete_pay_hand) == "undefined" || param.complete_pay_hand == 'null' || param.complete_pay_hand == null) {
+      param.complete_pay_hand = 0
+    }
+    if (typeof (param.pay_mode_hand) == "undefined" || param.pay_mode_hand == 'null' || param.pay_mode_hand == null) {
+      param.pay_mode_hand = 4
+    }
+    if (typeof (param.is_same_hand) == "undefined" || param.is_same_hand == 'null' || param.is_same_hand == null) {
+      param.is_same_hand = 0
+    }
+    if (typeof (param.is_wt_hand) == "undefined" || param.is_wt_hand == 'null' || param.is_wt_hand == null) {
+      param.is_wt_hand = 0
+    }
+    if (typeof (param.is_xjf_hand) == "undefined" || param.is_xjf_hand == 'null' || param.is_xjf_hand == null) {
+      param.is_xjf_hand = 0
+    }
+    if (typeof (param.is_pay_hand) == "undefined" || param.is_pay_hand == 'null' || param.is_pay_hand == null) {
+      param.is_pay_hand = 1
+    }
+    if (typeof (param.complete_new_hand) == "undefined" || param.complete_new_hand == 'null' || param.complete_new_hand == null) {
+      param.complete_new_hand = 0
+    }
+    if (typeof (param.complete_lc_hand) == "undefined" || param.complete_lc_hand == 'null' || param.complete_lc_hand == null) {
+      param.complete_lc_hand = 0
+    }
+    const exists = await this.ShuyouGameCompleteHandEntity.findOne({
+      task_id: param.task_id,
+      new_date: param.new_date
+    });
+    param.createTime = new Date()
+    param.updateTime = new Date()
+    if (param.is_same_hand == 0) {
+      param.amount_hand = parseFloat(param.price_hand) * parseFloat(param.complete_pay_hand)
+    }
+    if (!_.isEmpty(exists)) {   //修改
+      let object = {
+        complete_new_hand: param.complete_new_hand,
+        complete_lc_hand: param.complete_lc_hand,
+        is_pay_hand: param.is_pay_hand,
+        complete_pay_hand: param.complete_pay_hand,
+        price_hand: param.price_hand,
+        amount_hand: param.amount_hand,
+        pay_mode_hand: param.pay_mode_hand,
+        other_pay_hand: param.other_pay_hand,
+        is_same_hand: param.is_same_hand,
+        account_hand: param.account_hand,
+        is_wt_hand: param.is_wt_hand,
+        is_xjf_hand: param.is_xjf_hand
+      }
+      const updateResult = await this.ShuyouGameCompleteHandEntity
+        .createQueryBuilder()
+        .update()
+        .set(object)
+        .where('task_id = :task_id and new_date = :new_date', {
+          task_id: param.task_id,
+          new_date: param.new_date
+        })
+        .execute();
+      if (updateResult.affected >= 1) {
+        // throw new CoolCommException('修改成功~');
+        // console.log('修改成功~')
+      } else {
+        // throw new CoolCommException('修改成功~');
+        console.log('修改失败~')
+      }
+    } else {
+      //新增
+      let object = {
+        task_id: param.task_id,
+        new_date: param.new_date,
+        complete_new_hand: param.complete_new_hand,
+        complete_lc_hand: param.complete_lc_hand,
+        is_pay_hand: param.is_pay_hand,
+        complete_pay_hand: param.complete_pay_hand,
+        price_hand: param.price_hand,
+        amount_hand: param.amount_hand,
+        pay_mode_hand: param.pay_mode_hand,
+        other_pay_hand: param.other_pay_hand,
+        is_same_hand: param.is_same_hand,
+        account_hand: param.account_hand,
+        is_wt_hand: param.is_wt_hand,
+        is_xjf_hand: param.is_xjf_hand
+      }
+      await this.ShuyouGameCompleteHandEntity.insert(object)
+
+    }
+  }
+
+
+}

+ 267 - 6
cool-admin-midway-master/src/app/modules/shuyou/service/game_target.ts

@@ -7,6 +7,11 @@ import { ShuyouGameTargetEntity } from '../entity/game_target';
 import { ILogger } from '@midwayjs/logger';
 import { ShuyouGameTaskEntity } from '../entity/game_task';
 import { Utils } from '../../../comm/utils';
+import { ShuyouGameCompleteHandService } from './game_complete_hand';
+import { ShuyouGameCompleteHandEntity } from '../entity/game_complete_hand';
+import { ShuyouXJFUtilsService } from './utils_xjf';
+import { ShuyouGameCompleteHandCardEntity } from '../entity/game_complete_hand_card';
+const axios = require('axios')
 /**
  * 游戏目标
  */
@@ -22,11 +27,26 @@ export class ShuyouGameTargetService extends BaseService {
   @Inject()
   utils: Utils;
 
+  @Inject()
+  ShuyouGameCompleteHandService: ShuyouGameCompleteHandService;
+
+  @InjectEntityModel(ShuyouGameCompleteHandEntity)
+  ShuyouGameCompleteHandEntity: Repository<ShuyouGameCompleteHandEntity>;
+
+  @InjectEntityModel(ShuyouGameTaskEntity)
+  ShuyouGameTaskEntity: Repository<ShuyouGameTaskEntity>;
+
+  @Inject()
+  ShuyouXJFUtilsService: ShuyouXJFUtilsService;
+
+  @InjectEntityModel(ShuyouGameCompleteHandCardEntity)
+  ShuyouGameCompleteHandCardEntity: Repository<ShuyouGameCompleteHandCardEntity>;
+
   /**
   * 重载修改接口
   */
   async update(param) {
-    console.log(param)
+    // console.log(param)
     const exists = await this.ShuyouGameTargetEntity.findOne({
       id: param.id,
     });
@@ -70,11 +90,128 @@ export class ShuyouGameTargetService extends BaseService {
         .execute();
       if (updateResult.affected >= 1) {
         // throw new CoolCommException('修改成功~');
-        console.log('修改成功~')
+        // console.log('修改成功~')
       } else {
         // throw new CoolCommException('修改成功~');
         console.log('修改失败~')
       }
+      //修改手动完成情况
+      //==================================
+      let obj = {
+        task_id: param.task_id,
+        new_date: param.new_date,
+        complete_new_hand: param.complete_new_hand,
+        complete_lc_hand: param.complete_lc_hand,
+        is_pay_hand: param.is_pay_hand,
+        complete_pay_hand: param.complete_pay_hand,
+        price_hand: param.price_hand,
+        amount_hand: param.amount_hand,
+        pay_mode_hand: param.pay_mode_hand,
+        other_pay_hand: param.other_pay_hand,
+        is_same_hand: param.is_same_hand,
+        account_hand: param.account_hand,
+        is_wt_hand: param.is_wt_hand,
+        is_xjf_hand: param.is_xjf_hand
+      }
+      //查询本次修改之前的数据
+      const oldCompleteHandEntity = await this.ShuyouGameCompleteHandEntity.findOne({
+        task_id: param.task_id,
+        new_date: param.new_date
+      });
+      let old_amount_hand = 0
+      let old_complete_pay_hand = 0
+      if (oldCompleteHandEntity) {
+        old_amount_hand = oldCompleteHandEntity.amount_hand
+        old_complete_pay_hand = oldCompleteHandEntity.complete_pay_hand
+      }
+      //=============
+      await this.ShuyouGameCompleteHandService.addOrUpdate(obj)
+      //上传WT start=======================
+      if (param.is_wt_hand == 1 || param.is_xjf_hand == 1) {
+        const taskInfo = await this.ShuyouGameTaskEntity.findOne({ id: param.task_id })
+        // console.log(taskInfo)
+        if (taskInfo) {
+          let game_id = ''
+          let channel_id = ''
+          let url = ''
+          let new_amount_hand = 0
+          let new_complete_pay_hand = 0
+          if (param.is_wt_hand == 1) {
+            if (param.is_same_hand == 0) {
+              new_amount_hand = parseFloat(param.price_hand) * parseFloat(param.complete_pay_hand) - parseFloat(old_amount_hand + '')
+            } else {
+              new_amount_hand = parseFloat(param.amount_hand) - parseFloat(old_amount_hand + '')
+            }
+            if (taskInfo.game_agentId == 5) {
+              //魅族
+              game_id = taskInfo.mz_id
+              channel_id = taskInfo.mz_channel
+              url = 'https://sy.nkfzs.com/v2/data_collect/game_task_report_meizu?channel_id=' + channel_id + '&game_id=' + game_id + '&type=3&account=hand_' + new Date().getTime() + '&money=' + new_amount_hand
+            } else if (taskInfo.game_agentId == 1) {
+              //腾讯
+              game_id = taskInfo.qq_id
+              channel_id = taskInfo.qq_channel
+              url = 'https://sy.nkfzs.com/v2/data_collect/game_task_report?channel_id=' + channel_id + '&game_id=' + game_id + '&type=3&account=hand_' + new Date().getTime() + '&money=' + new_amount_hand
+            }
+            // console.log(url)
+            new Promise(function (resolve, reject) {
+              axios.get(url)
+                .then((res: string) => {
+                  // console.log(res)
+                  resolve(res);
+                })
+                .catch((error: any) => {
+                  // console.log(error)
+                  resolve(error)
+                  // reject(error)
+                })
+            });
+          }
+          if (param.is_xjf_hand == 1) {
+            new_complete_pay_hand = parseInt(param.complete_pay_hand) - parseInt(old_complete_pay_hand + '')
+            //上传手动付费到xjf后台
+            game_id = taskInfo.xjf_id + ''
+            for (var i = 0; i < new_complete_pay_hand; i++) {
+              await this.ShuyouXJFUtilsService.uploadLog(game_id, 'hand' + i + '_' + new Date().getTime(), '付费充值', '付费成功', '');
+            }
+
+            //记录 QQ卡消耗 start=========================
+            const card_list = param.card_list
+            if (card_list && param.pay_mode_hand == 0) {
+              //删除之前该游戏该日期的QQ卡记录
+              await this.ShuyouGameCompleteHandCardEntity.delete({
+                task_id: param.task_id,
+                new_date: param.new_date
+              });
+              for (const item of card_list) {
+                if (item.card_account != '' || item.card_balance != '') {
+                  // console.log(item)
+                  // 上传手动做付费的QQ卡,game_id,card_account,card_balance
+                  let qqConsume
+                  // console.log(game_id + '----' + item.card_account + '----' + item.card_balance)
+                  qqConsume = await this.ShuyouXJFUtilsService.uploadQQconsume(game_id, item.card_account, item.card_balance);
+                  // console.log(qqConsume)
+                  if (qqConsume.data == 'ok') {
+                    await this.ShuyouGameCompleteHandCardEntity.save({
+                      task_id: param.task_id,
+                      new_date: param.new_date,
+                      card_account: item.card_account,
+                      card_balance: item.card_balance
+                    });
+                  } else {
+                    throw new CoolCommException(qqConsume.data)
+                  }
+                } else {
+                  throw new CoolCommException('添加的qq卡信息不能为空')
+                }
+              }
+            }
+            //记录 QQ卡消耗 end=========================
+          }
+        }
+      }
+      //上传WT end=======================
+      //==================================
     } else {
       throw new CoolCommException('未查询到数据,无法修改~');
     }
@@ -242,17 +379,20 @@ export class ShuyouGameTargetService extends BaseService {
             SELECT
               a.id,a.task_id,a.task_name,DATE_FORMAT(a.new_date,'%Y-%m-%d') AS new_date,a.target_new,a.target_pay,a.target_active,
               IFNULL(c.complete_new, 0) AS complete_new,IFNULL(c.complete_pay, 0) AS complete_pay,game_rate,game_rate_xmy,
-              IFNULL(c.complete_active,0) AS complete_active,c.updateTime,c.is_complete,c.amount,
+              IFNULL(c.complete_active,0) AS complete_active,c.updateTime,c.is_complete,c.amount,t.xjf_id,
               b.name AS directorName,b.id AS directorId,t.login_modeId AS login_modeId,
               d.type_id AS type_id,d.reason AS reason,d.solution AS solution,
               if(a.target_new - complete_new < 0, 0, a.target_new-complete_new) AS incomplete_new,
               if(a.target_pay - complete_pay < 0, 0, a.target_pay-complete_pay) AS incomplete_pay,
-              if(a.target_active - complete_active < 0, 0, a.target_active-complete_active) AS incomplete_active
+              if(a.target_active - complete_active < 0, 0, a.target_active-complete_active) AS incomplete_active,
+              m.complete_new_hand,m.complete_lc_hand,m.is_pay_hand,m.complete_pay_hand,m.price_hand,m.amount_hand,m.pay_mode_hand,
+              m.other_pay_hand,m.is_same_hand,m.account_hand,m.is_wt_hand,m.is_xjf_hand
             FROM
               shuyou_game_target a
               LEFT JOIN shuyou_game_task t ON a.task_id = t.id
               LEFT JOIN shuyou_game_director b ON a.directorId = b.id
               LEFT JOIN shuyou_game_complete c ON a.task_id = c.task_id AND a.new_date = c.new_date 
+              LEFT JOIN shuyou_game_complete_hand m ON a.task_id = m.task_id AND a.new_date = m.new_date 
               LEFT JOIN shuyou_reason_incomplete d ON a.task_id = d.task_id AND a.new_date = d.new_date 
             WHERE
               1 = 1
@@ -264,8 +404,114 @@ export class ShuyouGameTargetService extends BaseService {
             ${this.setSql(new_date, 'and a.new_date >= ? and a.new_date <= ?', [this.utils.formatDate(new Date(new_date[0])), this.utils.formatDate(new Date(new_date[1]))])}
             ${this.setSql(is_complete, 'and c.is_complete = ?', [is_complete])}
         `;
-    return this.sqlRenderPage(sql, query);
+    const result = await this.sqlRenderPage(sql, query);
+    let page = 0
+    let size = 0
+    let total = 0
+    let pageInfo = []
+    if (result) {
+      page = result.pagination.page
+      size = result.pagination.size
+      total = result.pagination.total
+      await ykhForeach(result.list, async (item, index) => {
+        let obj = item
+        const handCardEntitys = await this.ShuyouGameCompleteHandCardEntity.find({
+          task_id: item.task_id,
+          new_date: item.new_date
+        });
+        let cardList = []
+        if (handCardEntitys) {
+          handCardEntitys.forEach(h => {
+            let obj_son = {
+              card_account: h.card_account,
+              card_balance: h.card_balance
+            }
+            cardList.push(obj_son)
+          });
+        }
+        obj.card_list = cardList
+        pageInfo.push(obj)
+      })
+    }
+    // console.log(pageInfo)
+    let sqlRenderPage = {
+      list: pageInfo,
+      pagination: {
+        page: page,
+        size: size,
+        total: total
+      }
+    }
+    // console.log(sqlRenderPage)
+    return sqlRenderPage
+
   }
+
+  /**
+   * 重载info接口
+   * @memberof ShuyouGameTargetService
+   */
+  async info(id) {
+    let info
+    const shuyouGameTargetEntity = await this.ShuyouGameTargetEntity.findOne({ id });
+    const shuyouGameCompleteHandEntity = await this.ShuyouGameCompleteHandEntity.findOne({
+      task_id: shuyouGameTargetEntity.task_id,
+      new_date: shuyouGameTargetEntity.new_date
+    });
+    // const handCardEntitys = await this.ShuyouGameCompleteHandCardEntity.find({
+    //   task_id: shuyouGameTargetEntity.task_id,
+    //   new_date: shuyouGameTargetEntity.new_date
+    // });
+    // let cardList = []
+    // if (handCardEntitys) {
+    //   handCardEntitys.forEach(e => {
+    //     cardList.push(e)
+    //   });
+    // }
+    info = shuyouGameTargetEntity
+    // info.card_list = cardList
+    if (shuyouGameCompleteHandEntity) {
+      info.complete_new_hand = shuyouGameCompleteHandEntity.complete_new_hand;
+      info.complete_lc_hand = shuyouGameCompleteHandEntity.complete_lc_hand;
+      info.is_pay_hand = shuyouGameCompleteHandEntity.is_pay_hand;
+      info.complete_pay_hand = shuyouGameCompleteHandEntity.complete_pay_hand;
+      info.price_hand = shuyouGameCompleteHandEntity.price_hand;
+      info.amount_hand = shuyouGameCompleteHandEntity.amount_hand;
+      info.pay_mode_hand = shuyouGameCompleteHandEntity.pay_mode_hand;
+      info.other_pay_hand = shuyouGameCompleteHandEntity.other_pay_hand;
+      info.is_same_hand = shuyouGameCompleteHandEntity.is_same_hand;
+      info.account_hand = shuyouGameCompleteHandEntity.account_hand;
+      info.is_wt_hand = shuyouGameCompleteHandEntity.is_wt_hand;
+      info.is_xjf_hand = shuyouGameCompleteHandEntity.is_xjf_hand;
+      // info.card_list = [{ card_account: '', card_balance: '' }];
+    } else {
+      info.complete_new_hand = 0
+      info.complete_lc_hand = 0
+      info.complete_pay_hand = 0
+    }
+    return info;
+  }
+
+  /**
+     * 重新下发今日付费未成功的账号以及重置留存账号
+     * @memberof ShuyouGameTargetService
+     */
+  async resetPay(id) {
+    const ShuyouGameTaskEntity = await this.ShuyouGameTaskEntity.findOne({ id });
+    if (ShuyouGameTaskEntity) {
+      // console.log(ShuyouGameTaskEntity)
+      let message
+      message = await this.ShuyouXJFUtilsService.resetPay(ShuyouGameTaskEntity.xjf_id);
+      if (message.data == 'ok') {
+        return { code: 1000, data: message.data }
+      } else {
+        return { code: -1, data: message.data }
+      }
+    } else {
+      return { code: -1, data: '未找到xjf_id' }
+    }
+  }
+
   /**
   * 查询任务目标与完成
   * @param query
@@ -276,7 +522,7 @@ export class ShuyouGameTargetService extends BaseService {
           SELECT
               a.task_id,a.task_name,a.target_new,a.target_pay,a.target_active,
               IFNULL(c.complete_new, 0) AS complete_new,IFNULL(c.complete_pay, 0) AS complete_pay,game_rate,game_rate_xmy,
-              IFNULL(c.complete_active,0) AS complete_active,c.is_complete,c.amount,xmy_id,qq_channel,qq_id,
+              IFNULL(c.complete_active,0) AS complete_active,c.is_complete,c.amount,xmy_id,qq_channel,qq_id,mz_id,mz_channel,
               b.name AS directorName,l.name AS login_mode,g.name AS game_agent,
               d.type_id AS type_id,d.reason AS reason,d.solution AS solution,
               if(a.target_new - complete_new < 0, 0, a.target_new-complete_new) AS incomplete_new,
@@ -300,3 +546,18 @@ export class ShuyouGameTargetService extends BaseService {
   }
 
 }
+
+// foreach加上async/await
+const ykhForeach = async (arr, callback) => {
+  const length = arr.length;
+  const O = Object(arr);
+  let k = 0;
+  while (k < length) {
+    if (k in O) {
+      // console.log('doing foreach...');
+      const kValue = O[k];
+      await callback(kValue, k, O);
+    }
+    k++;
+  }
+};

+ 3 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/game_target_tencent.ts

@@ -102,6 +102,9 @@ export class ShuyouGameTargetTencentService extends BaseService {
         await sendVx_Robot(directorName + ':' + param.task_name + ',' + content);
         //钉钉机器人
         await this.shuyouUtilsService.postRobot(dingContent, dingPhone)
+        //企业微信机器人
+        await this.shuyouUtilsService.postRobotEnterpriseWeChat(dingContent)
+        await this.shuyouUtilsService.postRobotEnterpriseWeChat2(dingContent)
         // console.log('修改成功~')
       } else {
         // throw new CoolCommException('修改成功~');

+ 178 - 8
cool-admin-midway-master/src/app/modules/shuyou/service/game_task.ts

@@ -12,6 +12,9 @@ import { ShuyouGameAgentService } from '../service/game_agent';
 import { ShuyouTaskGameRecordEntity } from '../entity/task_game_record';
 import { ShuyouLoModeService } from './lo_mode';
 import { ShuyouGameDirectorService } from './game_director';
+import { ShuyouXJFUtilsService } from './utils_xjf';
+import { ShuyouGameDirectorEntity } from '../entity/game_director';
+import { ShuyouGameAgentEntity } from '../entity/game_agent';
 
 /**
  * 系统用户
@@ -46,6 +49,15 @@ export class ShuyouGameTaskService extends BaseService {
   @Inject()
   utils: Utils;
 
+  @Inject()
+  ShuyouXJFUtilsService: ShuyouXJFUtilsService;
+
+  @InjectEntityModel(ShuyouGameDirectorEntity)
+  ShuyouGameDirectorEntity: Repository<ShuyouGameDirectorEntity>;
+
+  @InjectEntityModel(ShuyouGameAgentEntity)
+  ShuyouGameAgentEntity: Repository<ShuyouGameAgentEntity>;
+
   /**
    * 重载新增接口
    */
@@ -54,16 +66,11 @@ export class ShuyouGameTaskService extends BaseService {
       id: param.id,
     });
     if (!_.isEmpty(existsTask)) {
-      throw new CoolCommException('已存在相同任务id~');
+      throw new CoolCommException('本平台已存在相同任务id~');
     }
     param.createTime = new Date()
     param.updateTime = new Date()
     // console.log(param)
-    // 创建游戏目标start==========================
-    const existsTarget = await this.ShuyouGameTargetEntity.findOne({
-      task_id: param.id,
-      new_date: param.new_date
-    });
     let target_new = 0
     let target_pay = 0
     let target_active = 0
@@ -71,6 +78,63 @@ export class ShuyouGameTaskService extends BaseService {
     target_pay = Math.floor(Math.random() * (parseInt(param.target_pay_high) - parseInt(param.target_pay_low) + 1) + parseInt(param.target_pay_low))
     target_active = Math.floor(Math.random() * (parseInt(param.target_active_high) - parseInt(param.target_active_low) + 1) + parseInt(param.target_active_low))
     //
+    //此处先创建机房后台的任务
+    //机房后台的任务开始=========================
+    //先查询出负责人名称与厂商端口名称
+    const gameDirectorEntity = await this.ShuyouGameDirectorEntity.findOne({
+      id: param.directorId
+    });
+    const gameAgentEntity = await this.ShuyouGameAgentEntity.findOne({
+      id: param.game_agentId
+    });
+    if (_.isEmpty(gameDirectorEntity || gameAgentEntity)) {
+      throw new CoolCommException('负责人名称与厂商端口名称错误~');
+    }
+    const gameDirectorName = gameDirectorEntity.name
+    const gameAgentName = gameAgentEntity.name
+    //
+    let xjf_object = {
+      "date": param.new_date,
+      "game_id": parseInt(param.id),
+      "game_name": param.task_name,
+      "new_target": target_new,
+      "retained_target": 0,
+      "pay_target": target_pay,
+      "pay_price": param.target_pay_low,     //需要处理
+      "remark": gameDirectorName,
+      "spirit_package_name": '0',
+      "game_package_name": '0',
+      "game_id_xmy": param.xmy_id,
+      "sy_data_id": parseInt(param.id),
+      "new_retained": param.new_retained + '',       //需要在数据库添加该字段
+      "game_url": param.download,
+      "game_port": gameAgentName
+    }
+    //
+    let createXJF
+    createXJF = await this.ShuyouXJFUtilsService.createXJF(xjf_object);
+    // console.log(createXJF.data)
+    if (!_.isEmpty(createXJF) && createXJF.status == 200) {
+      param['xjf_id'] = createXJF.data  //获取到机房后台game_id
+      // console.log('机房后台game_id' + createXJF.data)
+      //机房后台开始游戏
+      let startXJF
+      startXJF = await this.ShuyouXJFUtilsService.startXJF(parseInt(createXJF.data));
+      // console.log(startXJF)
+      if (_.isEmpty(startXJF) || startXJF.status != 200) {
+        throw new CoolCommException(startXJF.data);
+      }
+    } else if (!_.isEmpty(createXJF.response)) {
+      //抛出具体的返回值
+      throw new CoolCommException(createXJF.response.data);
+    }
+    //机房后台的任务结束=========================
+    // 创建游戏目标start==========================
+    const existsTarget = await this.ShuyouGameTargetEntity.findOne({
+      task_id: param.id,
+      new_date: param.new_date
+    });
+
     if (!_.isEmpty(existsTarget)) {
       // 当天的任务目标已存在,执行更新目标
       let targetValue = {
@@ -153,7 +217,8 @@ export class ShuyouGameTaskService extends BaseService {
     const sql = `
             SELECT
             a.id,a.task_name,a.new_date,a.createTime,a.updateTime,a.target_new_low,a.target_new_high,a.target_pay_low,a.target_pay_high,a.target_active_low,a.target_active_high,
-            a.lc_two_ratio,a.lc_three_ratio,a.lc_four_ratio,a.lc_five_ratio,a.lc_six_ratio,a.lc_seven_ratio,a.lc_eight_ratio,a.lc_fifteen_ratio,a.lc_thirty_ratio,a.stopTime,a.stopRemark,
+            a.lc_two_ratio,a.lc_three_ratio,a.lc_four_ratio,a.lc_five_ratio,a.lc_six_ratio,a.lc_seven_ratio,a.lc_eight_ratio,a.lc_fifteen_ratio,a.lc_thirty_ratio,a.stopTime,
+            a.stopRemark,a.new_retained,
             a.remark,a.is_run,a.is_repeat,a.xmy_id,a.qq_channel,a.qq_id,a.mz_channel,a.mz_id,a.download,a.unit_price_low,a.unit_price_high,
             any_value (b.name) AS directorName,b.id AS directorId,
             any_value (c.name) AS login_modeId,
@@ -171,7 +236,7 @@ export class ShuyouGameTaskService extends BaseService {
           WHERE 1 = 1
             ${this.setSql(id, 'and a.id = ?', [id])}
             ${this.setSql(task_name, 'and a.task_name LIKE ?', [`%${task_name}%`])}
-            ${this.setSql(is_run, 'and a.is_run = ?', [is_run])}
+            ${this.setSql((is_run == 1 || is_run == 0), 'and a.is_run = ?', [is_run])}
             ${this.setSql(directorId, 'and b.id = ?', [directorId])}
             ${this.setSql(game_agentId, 'and d.id = ?', [game_agentId])}
             ${this.setSql(account_typeId, 'and e.id = ?', [account_typeId])}
@@ -216,6 +281,63 @@ export class ShuyouGameTaskService extends BaseService {
     if (!taskInfo) {
       throw new CoolCommException('任务不存在');
     }
+    const xjf_id = taskInfo.xjf_id
+    if (xjf_id != 0) {
+      //修改机房后台任务信息开始=========================
+      //先查询出负责人名称与厂商端口名称
+      const gameDirectorEntity = await this.ShuyouGameDirectorEntity.findOne({
+        id: param.directorId
+      });
+      const gameAgentEntity = await this.ShuyouGameAgentEntity.findOne({
+        id: param.game_agentId
+      });
+      if (_.isEmpty(gameDirectorEntity || gameAgentEntity)) {
+        throw new CoolCommException('负责人名称与厂商端口名称错误~');
+      }
+      const gameDirectorName = gameDirectorEntity.name
+      const gameAgentName = gameAgentEntity.name
+      let xjf_object = {
+        "date": this.utils.formatDate(new Date()),
+        "game_id": xjf_id,
+        "game_name": param.task_name,
+        "new_target": 0,
+        "retained_target": 0,
+        "pay_target": 0,
+        "pay_price": param.target_pay_low,     //需要处理
+        "remark": gameDirectorName,
+        "spirit_package_name": '0',
+        "game_package_name": '0',
+        "game_id_xmy": param.xmy_id,
+        "sy_data_id": parseInt(param.id),
+        "new_retained": param.new_retained + '',
+        "game_url": param.download,
+        "game_port": gameAgentName
+      }
+      //
+      let queryXjfId
+      queryXjfId = await this.ShuyouXJFUtilsService.queryXjfId(xjf_id);
+      let xjfData
+      if (_.isEmpty(queryXjfId) || queryXjfId == -1) {
+        xjfData = {
+          "IdDong": 0,
+          "IdYang": 0
+        }
+      } else {
+        xjfData = queryXjfId.data
+      }
+      // console.log(xjfData.IdYang)
+      // console.log(xjfData.IdDong)
+      if (xjfData.IdDong > 0) {
+        let updateXJF
+        updateXJF = await this.ShuyouXJFUtilsService.updateXJF(xjfData.IdDong, xjf_object);
+        // console.log(updateXJF.data)
+        if (_.isEmpty(updateXJF) || updateXJF.status != 200 || updateXJF.data != 'OK') {
+          throw new CoolCommException(updateXJF.data);
+        }
+      }
+      //修改机房后台任务信息结束=================================
+    }
+
     const old_game_agentId = taskInfo.game_agentId
     const old_login_modeId = taskInfo.login_modeId
     const old_directorId = taskInfo.directorId
@@ -311,6 +433,34 @@ export class ShuyouGameTaskService extends BaseService {
     //===================================================================================
     // console.log(id)
     // console.log(this.utils.formatDate(new Date()))
+    //机房后台删除任务============================
+    const taskInfo = await this.ShuyouGameTaskEntity.findOne({ id: id });
+    if (!taskInfo) {
+      throw new CoolCommException('任务不存在');
+    }
+    const xjf_id = taskInfo.xjf_id
+    if (xjf_id != 0) {
+      let queryXjfId
+      queryXjfId = await this.ShuyouXJFUtilsService.queryXjfId(xjf_id);
+      let xjfData
+      if (_.isEmpty(queryXjfId) || queryXjfId == -1) {
+        xjfData = {
+          "IdDong": 0,
+          "IdYang": 0
+        }
+      } else {
+        xjfData = queryXjfId.data
+      }
+      if (xjfData.IdDong > 0) {
+        let deleteXJF
+        deleteXJF = await this.ShuyouXJFUtilsService.deleteXJF(xjfData.IdDong);
+        // console.log(deleteXJF)
+        if (_.isEmpty(deleteXJF) || deleteXJF.status != 200) {
+          throw new CoolCommException(deleteXJF.data);
+        }
+      }
+    }
+    //=============================================
     await this.ShuyouTaskGameRecordEntity.delete({ task_id: id });
     await this.ShuyouGameTaskEntity.delete({ id: id });
     await this.ShuyouGameTargetEntity.delete({ task_id: id, new_date: this.utils.formatDate(new Date()) })
@@ -343,6 +493,16 @@ export class ShuyouGameTaskService extends BaseService {
       ShuyouGameTaskEntity.stopRemark = stopRemark;
       // this.logger.info(ShuyouGameTaskEntity)
       await this.ShuyouGameTaskEntity.save(ShuyouGameTaskEntity);
+      //机房后台停止游戏=============================
+      if (ShuyouGameTaskEntity.xjf_id != 0) {
+        let stopXJF
+        stopXJF = await this.ShuyouXJFUtilsService.stopXJF(ShuyouGameTaskEntity.xjf_id);
+        // console.log(stopXJF)
+        if (_.isEmpty(stopXJF) || stopXJF.status != 200) {
+          throw new CoolCommException(stopXJF.data);
+        }
+      }
+      //=======================================
       return 1000
     } else {
       return -1
@@ -368,6 +528,16 @@ export class ShuyouGameTaskService extends BaseService {
       ShuyouGameTaskEntity.stopRemark = '';
       // this.logger.info(ShuyouGameTaskEntity)
       await this.ShuyouGameTaskEntity.save(ShuyouGameTaskEntity);
+      //机房后台开始游戏=============================
+      if (ShuyouGameTaskEntity.xjf_id != 0) {
+        let startXJF
+        startXJF = await this.ShuyouXJFUtilsService.startXJF(ShuyouGameTaskEntity.xjf_id);
+        // console.log(startXJF)
+        if (_.isEmpty(startXJF) || startXJF.status != 200) {
+          throw new CoolCommException(startXJF.data);
+        }
+      }
+      //=======================================
       return 1000
     } else {
       return -1

+ 19 - 1
cool-admin-midway-master/src/app/modules/shuyou/service/reason_incomplete.ts

@@ -22,7 +22,7 @@ export class ShuyouReasonIncompleteService extends BaseService {
    * 重载新增接口
    */
   async add(param) {
-    console.log(param)
+    // console.log(param)
     const exists = await this.ShuyouReasonIncompleteEntity.findOne({
       task_id: param.task_id,
       new_date: param.new_date
@@ -30,6 +30,15 @@ export class ShuyouReasonIncompleteService extends BaseService {
     param.createTime = new Date()
     param.updateTime = new Date()
     if (!_.isEmpty(exists)) {
+      if (typeof (param.incomplete_new) == "undefined") {
+        param.incomplete_new = exists.incomplete_new
+      }
+      if (typeof (param.incomplete_pay) == "undefined") {
+        param.incomplete_pay = exists.incomplete_pay
+      }
+      if (typeof (param.incomplete_active) == "undefined") {
+        param.incomplete_active = exists.incomplete_active
+      }
       let addObj = {
         incomplete_new: param.incomplete_new,
         incomplete_pay: param.incomplete_pay,
@@ -75,6 +84,15 @@ export class ShuyouReasonIncompleteService extends BaseService {
     param.createTime = new Date()
     param.updateTime = new Date()
     if (!_.isEmpty(exists)) {
+      if (typeof (param.incomplete_new) == "undefined") {
+        param.incomplete_new = exists.incomplete_new
+      }
+      if (typeof (param.incomplete_pay) == "undefined") {
+        param.incomplete_pay = exists.incomplete_pay
+      }
+      if (typeof (param.incomplete_active) == "undefined") {
+        param.incomplete_active = exists.incomplete_active
+      }
       let addObj = {
         incomplete_new: param.incomplete_new,
         incomplete_pay: param.incomplete_pay,

+ 27 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/robot_enterprise_wechat.ts

@@ -0,0 +1,27 @@
+/*
+ * @Author: YKH
+ * @Date: 2022-04-14 14:38:01
+ * @LastEditTime: 2022-06-14 16:05:48
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\robot_enterprise_wechat.ts
+ */
+import { Provide } from '@midwayjs/decorator';
+import { BaseService } from 'midwayjs-cool-core';
+// import { InjectEntityModel } from '@midwayjs/orm';
+// import { Repository } from 'typeorm';
+import * as _ from 'lodash';
+// import { SyRobotEnterpriseWeChatEntity } from '../entity/robot_enterprise_wechat';
+
+/**
+ * 
+ */
+@Provide()
+export class SyRobotEnterpriseWeChatService extends BaseService {
+
+  // @InjectEntityModel(SyRobotEnterpriseWeChatEntity)
+  // SyRobotEnterpriseWeChatEntity: Repository<SyRobotEnterpriseWeChatEntity>;
+
+
+
+
+}

+ 123 - 2
cool-admin-midway-master/src/app/modules/shuyou/service/utils.ts

@@ -1,17 +1,21 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-11 21:36:52
- * @LastEditTime: 2022-01-20 14:30:42
+ * @LastEditTime: 2022-06-28 14:01:44
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\utils.ts
  */
-import { Provide } from '@midwayjs/decorator';
+import { Inject, Provide } from '@midwayjs/decorator';
 import { BaseService } from 'midwayjs-cool-core';
 import * as _ from 'lodash';
+import { Utils } from '../../../comm/utils';
 
 @Provide()
 export class ShuyouUtilsService extends BaseService {
 
+  @Inject()
+  utils: Utils;
+
   /***
    * 获取天气信息
    */
@@ -47,6 +51,38 @@ export class ShuyouUtilsService extends BaseService {
     return data;
   }
 
+  /**
+   *调用企业微信机器人发送消息Post:数优-加币/未完成播报群
+   * @return {*} 
+   * @memberof ShuyouUtilsService
+   */
+  async postRobotEnterpriseWeChat(text: string) {
+    const time = this.utils.formatDateTime(new Date())
+    const data = await postRobotEnterpriseWeChat(text, time)
+    return data;
+  }
+
+  /**
+   *调用企业微信机器人发送消息Post到:数据优化-深圳项目对接群
+   * @return {*} 
+   * @memberof ShuyouUtilsService
+   */
+  async postRobotEnterpriseWeChat2(text: string) {
+    const time = this.utils.formatDateTime(new Date())
+    const data = await postRobotEnterpriseWeChat2(text, time)
+    return data;
+  }
+  /**
+     *调用企业微信机器人发送消息Post到:数优资源报警群
+     * @return {*} 
+     * @memberof ShuyouUtilsService
+     */
+  async postRobotEnterpriseWeChat3(text: string) {
+    const time = this.utils.formatDateTime(new Date())
+    const data = await postRobotEnterpriseWeChat3(text, time)
+    return data;
+  }
+
 
 }
 
@@ -158,4 +194,89 @@ let postRobot = function (text: string, atMobiles: []) {
       })
   });
   return pm;
+}
+
+// 企业微信机器人发送消息post(数优-加币/未完成播报群)
+let postRobotEnterpriseWeChat = function (text: string, time: string) {
+  var access_token = '7d095d5b-8240-45fd-a68c-baff3628d83b';
+  var apiUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" + access_token;
+  let content = ``;
+  content = "**监控报警" + time + "** \n" + text + "\n > ##### [点击进入查看详细数据](http://ykhvip.fun) \n"
+  // console.log(content)
+  // "#### @18408246387监控报警 \n > 9度,西北风1级,空气良89,相对温度73%\n > ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n > ###### 10点20分发布 [天气](https://www.dingtalk.com) \n"
+  const axios = require('axios')
+  var pm = new Promise(function (resolve, reject) {
+    axios.post(apiUrl, {
+      "msgtype": "markdown",
+      "markdown": {
+        "content": content
+      }
+    })
+      .then((res) => {
+        // console.log(`statusCode: ${res.statusCode}`)
+        // console.log(res.data)
+        resolve(res.data);
+      })
+      .catch((error) => {
+        // console.error(error)
+        resolve(error)
+      })
+  });
+  return pm;
+}
+// 企业微信机器人发送消息post(数据优化-深圳项目对接群)
+let postRobotEnterpriseWeChat2 = function (text: string, time: string) {
+  var access_token = '5ccfb180-c062-48b5-ae18-0c96f7c19f0b';
+  var apiUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" + access_token;
+  let content = ``;
+  content = "**监控报警" + time + "** \n" + text + "\n > ##### [点击进入查看详细数据](http://ykhvip.fun) \n"
+  // console.log(content)
+  // "#### @18408246387监控报警 \n > 9度,西北风1级,空气良89,相对温度73%\n > ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n > ###### 10点20分发布 [天气](https://www.dingtalk.com) \n"
+  const axios = require('axios')
+  var pm = new Promise(function (resolve, reject) {
+    axios.post(apiUrl, {
+      "msgtype": "markdown",
+      "markdown": {
+        "content": content
+      }
+    })
+      .then((res) => {
+        // console.log(`statusCode: ${res.statusCode}`)
+        // console.log(res.data)
+        resolve(res.data);
+      })
+      .catch((error) => {
+        // console.error(error)
+        resolve(error)
+      })
+  });
+  return pm;
+}
+// 企业微信机器人发送消息post(数优资源报警群)
+let postRobotEnterpriseWeChat3 = function (text: string, time: string) {
+  var access_token = '34cbfa5a-c31d-464f-baf8-8363d6f4ac6a';
+  var apiUrl = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" + access_token;
+  let content = ``;
+  content = "**资源不足报警" + time + "** \n" + text + "\n"
+  // console.log(content)
+  // "#### @18408246387监控报警 \n > 9度,西北风1级,空气良89,相对温度73%\n > ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n > ###### 10点20分发布 [天气](https://www.dingtalk.com) \n"
+  const axios = require('axios')
+  var pm = new Promise(function (resolve, reject) {
+    axios.post(apiUrl, {
+      "msgtype": "markdown",
+      "markdown": {
+        "content": content
+      }
+    })
+      .then((res) => {
+        // console.log(`statusCode: ${res.statusCode}`)
+        // console.log(res.data)
+        resolve(res.data);
+      })
+      .catch((error) => {
+        // console.error(error)
+        resolve(error)
+      })
+  });
+  return pm;
 }

+ 327 - 0
cool-admin-midway-master/src/app/modules/shuyou/service/utils_xjf.ts

@@ -0,0 +1,327 @@
+
+import { Inject, Provide } from '@midwayjs/decorator';
+import { BaseService, CoolCommException } from 'midwayjs-cool-core';
+import * as _ from 'lodash';
+import { InjectEntityModel } from '@midwayjs/orm';
+import { ShuyouGameTaskEntity } from '../entity/game_task';
+import { Utils } from '../../../comm/utils';
+import { Repository } from 'typeorm';
+const axios = require('axios')
+
+@Provide()
+export class ShuyouXJFUtilsService extends BaseService {
+
+  @InjectEntityModel(ShuyouGameTaskEntity)
+  ShuyouGameTaskEntity: Repository<ShuyouGameTaskEntity>;
+
+  @Inject()
+  utils: Utils;
+
+  /**
+   * 新增任务
+   * @param {object} object
+   * @memberof ShuyouXJFUtilsService
+   */
+  async createXJF(object: object) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.post('http://xjf.lianyou.fun:8099/v1/task_statistics',
+        object
+      )
+        .then((res: string) => {
+          // console.log(res)
+          resolve(res);
+        })
+        .catch((error: any) => {
+          resolve(error)
+          // reject(error)
+        })
+    });
+    return pm;
+  }
+  /**
+   * 修改任务
+   * @param {object} object
+   * @memberof ShuyouXJFUtilsService
+   */
+  async updateXJF(xjf_id: number, object: object) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.put('http://xjf.lianyou.fun:8099/v1/task_statistics/' + xjf_id,
+        object
+      )
+        .then((res: string) => {
+          resolve(res);
+        })
+        .catch((error: any) => {
+          // console.error(error)
+          resolve(error)
+        })
+    });
+    return pm;
+  }
+  /**
+     * 删除任务
+     * @param {xjf_id} number
+     * @memberof ShuyouXJFUtilsService
+     */
+  async deleteXJF(xjf_id: number) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.delete('http://xjf.lianyou.fun:8099/v1/task_statistics/' + xjf_id)
+        .then((res: string) => {
+          resolve(res);
+        })
+        .catch((error: any) => {
+          // console.error(error)
+          resolve(error)
+        })
+    });
+    return pm;
+  }
+  /**
+     * 开始任务
+     * @param {game_id} number
+     * @memberof ShuyouXJFUtilsService
+     */
+  async startXJF(game_id: number) {
+    // console.log(game_id)
+    var pm = new Promise(function (resolve, reject) {
+      axios.get('http://xjf.lianyou.fun:8099/v1/install_info/updateinstallstatus?status=1&game_id=' + game_id
+      )
+        .then((res: string) => {
+          // console.log(res)
+          resolve(res);
+        })
+        .catch((error: any) => {
+          resolve(error)
+          // reject(error)
+        })
+    });
+    return pm;
+  }
+  /**
+     * 暂停任务
+     * @param {game_id} number
+     * @memberof ShuyouXJFUtilsService
+     */
+  async stopXJF(game_id: number) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.get('http://xjf.lianyou.fun:8099/v1/install_info/updateinstallstatus?status=0&game_id=' + game_id
+      )
+        .then((res: string) => {
+          // console.log(res)
+          resolve(res);
+        })
+        .catch((error: any) => {
+          resolve(error)
+          // reject(error)
+        })
+    });
+    return pm;
+  }
+
+  //根据gameid获取新机房信息
+  async queryXjfId(game_id: number) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.get('http://xjf.lianyou.fun:8099/v1/task_statistics/get_data_id?game_id=' + game_id
+      )
+        .then((res: string) => {
+          // console.log(res)
+          resolve(res);
+        })
+        .catch((error: any) => {
+          resolve(-1)
+          // reject(error)
+        })
+    });
+    return pm;
+  }
+
+  //重新下发今日付费未成功的账号以及重置留存账号
+  async resetPay(game_id: number) {
+    var pm = new Promise(function (resolve, reject) {
+      axios.get('http://xjf.lianyou.fun:8099/v1/task_statistics/rerun_retained?game_id=' + game_id
+      )
+        .then((res: string) => {
+          // console.log(res)
+          resolve(res);
+        })
+        .catch((error: any) => {
+          resolve(error)
+          // reject(error)
+        })
+    });
+    return pm;
+  }
+
+  /**
+   * xjf上传日志到机房
+   * @param {string} game_id
+   * @param {string} account
+   * @param {string} action
+   * @param {string} action_result
+   * @param {string} action_state
+   * @return {*} 
+   * @memberof ShuyouXJFUtilsService
+   */
+  async uploadLog(game_id: string, account: string, action: string, action_result: string, action_state: string) {
+    const url = 'http://xjf.lianyou.fun:8099/v1/device/setAccountLog?account=' + account + '&action=' + action + '&action_result=' + action_result + '&action_state=' + action_state + '&game_id=' + game_id
+    // console.log(url)
+    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;
+  }
+
+  //TODO
+  /**
+   * 上传给机房后台QQ卡消耗记录
+   * @param {string} game_id
+   * @param {string} card_account
+   * @param {string} card_balance
+   * @return {*} 
+   * @memberof ShuyouXJFUtilsService
+   */
+  async uploadQQconsume(game_id: string, card_account: string, card_balance: string) {
+    //上传手动做付费的QQ卡
+    // xjf.lianyou.fun:8099/v1/device/qq_card_hand?game_id=游戏ID&money=付费金额 &card_number=QQ卡号
+    const url = 'http://xjf.lianyou.fun:8099/v1/device/qq_card_hand?game_id=' + game_id + '&card_number=' + card_account + '&money=' + card_balance
+    // console.log(url)
+    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({ code: 1, data: html });
+        });
+      }).on('error', function (error) {
+        // reject(e)
+        resolve({ code: -1, data: error })
+      });
+    });
+    return pm;
+  }
+
+  //查询当前付费失败的账号//TODO
+  async payFailed(task_id: string) {
+    // console.log(task_id)
+    const existsTask = await this.ShuyouGameTaskEntity.findOne({
+      id: task_id,
+    });
+    if (_.isEmpty(existsTask)) {
+      throw new CoolCommException('未查询到game_id~~~');
+    }
+    // console.log(existsTask)
+    const game_id = existsTask.xjf_id
+    const new_date = this.utils.formatDate(new Date())
+    //
+    //小绵羊游戏获取付费失败http://ss.kfzs.com/v1/web/system_add_user/bi_config/unused_account?game_id=1000605&day=2022-06-27
+    var http = require('http');
+    var url = 'http://xjf.lianyou.fun:8099/v1/device/get_log_by_game?date=' + new_date + '&action=付费失败账号&action_result=占位&game_id=' + game_id
+    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({ code: 1, data: html });
+        });
+      }).on('error', function (error) {
+        // reject(e)
+        resolve({ code: -1, data: error })
+      });
+    });
+    return pm;
+  }
+  //查询今日可付费账号
+  async unpaid(task_id: string) {
+    // console.log(task_id)
+    const existsTask = await this.ShuyouGameTaskEntity.findOne({
+      id: task_id,
+    });
+    if (_.isEmpty(existsTask)) {
+      throw new CoolCommException('未查询到game_id~~~');
+    }
+    // console.log(existsTask)
+    const game_id = existsTask.xjf_id
+    const new_date = this.utils.formatDate(new Date())
+    //
+    var http = require('http');
+    var url = 'http://xjf.lianyou.fun:8099/v1/device/get_log_by_game?date=' + new_date + '&action=付费账号&action_result=占位&game_id=' + game_id
+    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({ code: 1, data: html });
+        });
+      }).on('error', function (error) {
+        // reject(e)
+        resolve({ code: -1, data: error })
+      });
+    });
+    return pm;
+  }
+
+  //手动充值-魅族
+  async handAddPayMz(xjf_id: string, account: string, pay_price: number) {
+    //
+    var http = require('http');
+    var url = 'http://xjf.lianyou.fun:8099/v1/device/setAccountLog?account=' + account + '&action=付费充值&action_result=魅族加币&game_id=' + xjf_id + '&money=' + pay_price
+    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({ code: 1, data: html });
+        });
+      }).on('error', function (error) {
+        // reject(e)
+        resolve({ code: -1, data: error })
+      });
+    });
+    return pm;
+  }
+  //强制手动充值-魅族
+  async forceAddPayMz(xjf_id: string, account: string, pay_price: number) {
+    //
+    var http = require('http');
+    var url = 'http://xjf.lianyou.fun:8099/v1/device/setAccountLog?account=' + account + '&action=付费充值&action_result=魅族加币无限制&game_id=' + xjf_id + '&money=' + pay_price
+    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({ code: 1, data: html });
+        });
+      }).on('error', function (error) {
+        // reject(e)
+        resolve({ code: -1, data: error })
+      });
+    });
+    return pm;
+  }
+
+
+}
+

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 595 - 319
cool-admin-midway-master/src/app/modules/task/service/shuyou.ts


+ 770 - 0
cool-admin-midway-master/src/app/modules/task/service/xjf_log_task.ts

@@ -0,0 +1,770 @@
+import { Inject, Logger, Provide } from '@midwayjs/decorator';
+import { BaseService } from 'midwayjs-cool-core';
+import { ILogger } from '@midwayjs/logger';
+import { Utils } from '../../../comm/utils';
+import * as _ from 'lodash';
+import { InjectEntityModel } from '@midwayjs/orm';
+import { Repository } from 'typeorm';
+import { ShuyouAbnormalRateEntity } from '../../shuyou/entity/data_abnormal_rate';
+import { ShuyouUtilsService } from '../../shuyou/service/utils';
+
+/**
+ * 描述
+ */
+@Provide()
+export class XjfLogTaskService extends BaseService {
+
+  @Logger()
+  logger: ILogger;
+
+  @Inject()
+  utils: Utils;
+
+  @InjectEntityModel(ShuyouAbnormalRateEntity)
+  ShuyouAbnormalRateEntity: Repository<ShuyouAbnormalRateEntity>;
+
+  @Inject()
+  shuyouUtilsService: ShuyouUtilsService;
+
+
+
+  async syncAbnormalRate() {
+    let new_date = this.utils.formatDate(new Date())
+    let hour = new Date().getHours()
+    // console.log(hour)
+    let updateTime = new Date()
+    this.logger.info('syncAbnormalRate>>>' + updateTime);
+
+    const sql = `
+      SELECT
+        a.task_id,
+        a.task_name,
+        a.new_date,
+        a.directorId,
+        b.login_modeId,
+        b.xjf_id
+      from 
+        shuyou_game_target a
+        LEFT JOIN shuyou_game_task b ON a.task_id = b.id
+      where 1 = 1 
+      ${this.setSql(new_date, 'and a.new_date = ? ORDER BY a.task_id', [new_date])}
+    `;
+    // console.log(sql)
+    const targetList = await this.nativeQuery(sql);
+    if (_.isEmpty(targetList)) {
+      return 'syncAbnormalRate >>> shuyou_game_target is null >>> ' + updateTime;
+    }
+    const logs = [
+      { action: '教程主线', action_result: '冻结' },
+      { action: '拉取账号', action_result: '成功' },
+      { action: '启动模拟器', action_result: '成功' },
+      { action: '启动游戏', action_result: '查询IP' },
+      { action: '脚本启动', action_result: '成功' },
+      { action: '启动游戏', action_result: '成功' },
+      { action: '登陆', action_result: '成功' },
+      { action: '教程主线', action_result: '进入游戏' },
+      { action: '教程主线', action_result: '新增成功' },
+      { action: '教程主线', action_result: '留存成功' },
+      { action: '付费充值', action_result: '付费成功' },
+      { action: '教程主线', action_result: '可以付费' },
+      { action: '留存账号总数', action_result: '留存账号总数' },
+      { action: '询问付费', action_result: '付费' }
+    ]
+
+    let data3 = await queryNewComputerRoom(new_date)
+    let newComputerRoomData = []
+    if (_.isEmpty(data3) || data3 == -1) {
+      // this.logger.warn('新机房后台数据错误')
+      newComputerRoomData = []
+    } else {
+      newComputerRoomData = JSON.parse(data3 + '')
+    }
+
+    await ykhForeach(targetList, async (item, index) => {
+      let task_id = item.task_id
+      let task_name = item.task_name
+      let directorId = item.directorId
+      let login_modeId = item.login_modeId
+      let xjf_id = item.xjf_id
+      // console.log(xjf_id)
+      let useXjf = false
+      let game_id = xjf_id
+      let xjfData
+
+      if (xjf_id != 0) {
+        let queryXjf
+        queryXjf = await queryXjfId(xjf_id)
+        // console.log(queryXjf)
+        if (_.isEmpty(queryXjf) || queryXjf == -1) {
+          xjfData = {
+            "IdDong": 0,
+            "IdYang": 0
+          }
+        } else {
+          xjfData = JSON.parse(queryXjf + '')
+        }
+        // console.log(xjfData)
+        // console.log(xjfData.IdYang)
+        if (xjfData.IdYang == task_id) {
+          useXjf = true
+        } else {
+          // return 'syncAbnormalRate  Fail>>>gameid is null' + updateTime;
+        }
+        let num_arr = []
+        if (useXjf == true) {
+          await ykhForeach(logs, async (e, i) => {
+            let action = e.action
+            const action_result = e.action_result
+            let num_xjfLog
+            if (i == 6) {
+              if (login_modeId == 1) {
+                //小绵羊登录 小绵羊登陆
+                let xmy1 = await queryXjfLog(new_date, '小绵羊登录', action_result, game_id)
+                let xmy2 = await queryXjfLog(new_date, '小绵羊登陆', action_result, game_id)
+                num_xjfLog = parseInt(xmy1 + '') + parseInt(xmy2 + '')
+              } else if (login_modeId == 2) {
+                //魅族登录 魅族登陆
+                let mz1 = await queryXjfLog(new_date, '魅族登录', action_result, game_id)
+                let mz2 = await queryXjfLog(new_date, '魅族登陆', action_result, game_id)
+                num_xjfLog = parseInt(mz1 + '') + parseInt(mz2 + '')
+              } else if (login_modeId == 3 || login_modeId == 5 || login_modeId == 6) {
+                //QQ登录 QQ登陆 微信登录 微信登陆
+                let num_xjfLog1 = await queryXjfLog(new_date, 'QQ登录', action_result, game_id)
+                let num_xjfLog2 = await queryXjfLog(new_date, '微信登录', action_result, game_id)
+                let num_xjfLog3 = await queryXjfLog(new_date, 'QQ登陆', action_result, game_id)
+                let num_xjfLog4 = await queryXjfLog(new_date, '微信登陆', action_result, game_id)
+                num_xjfLog = parseInt(num_xjfLog1 + '') + parseInt(num_xjfLog2 + '') + parseInt(num_xjfLog3 + '') + parseInt(num_xjfLog4 + '')
+              } else if (login_modeId == 4) {
+                //网易登录 网易登陆
+                let wy1 = await queryXjfLog(new_date, '网易登录', action_result, game_id)
+                let wy2 = await queryXjfLog(new_date, '网易登陆', action_result, game_id)
+                num_xjfLog = parseInt(wy1 + '') + parseInt(wy2 + '')
+              } else {
+              }
+            } else {
+              num_xjfLog = await queryXjfLog(new_date, action, action_result, game_id)
+            }
+            num_arr.push(num_xjfLog)
+          })
+          // console.log(num_arr)
+          let rate_all_step = 0
+          if (num_arr[7] != 0 && num_arr[5] != 0) {
+            rate_all_step = parseFloat(num_arr[7]) / parseFloat(num_arr[5])
+          }
+          let order_success_rate = '-/-/-%'
+          //
+          for (let newvalue of newComputerRoomData) {
+            if (newvalue.game_id == xjf_id) {
+              order_success_rate = newvalue.order_success_rate
+              break;
+            }
+          }
+          //
+          let rateObj = {
+            task_id: task_id,
+            task_name: task_name,
+            directorId: directorId,
+            new_date: new_date,
+            hour: hour,
+            num_frozen: num_arr[0],
+            num_pull_account: num_arr[1],
+            num_start_simulator: num_arr[2],
+            num_ip: num_arr[3],
+            num_start_script: num_arr[4],
+            num_start_game: num_arr[5],
+            num_login_success: num_arr[6],
+            num_into_game: num_arr[7],
+            num_new_success: num_arr[8],
+            num_lc_success: num_arr[9],
+            num_pay_success: num_arr[10],
+            rate_all_step: rate_all_step,
+            num_could_pay: num_arr[11],  // 可以付费的账号
+            num_account_lc: num_arr[12],  //留存账号总数
+            num_pull_pay: num_arr[13],  // 下发付费账号
+            order_success_rate: order_success_rate
+          }
+
+          // console.log(rateObj)
+          const AbnormalRateEntity = await this.ShuyouAbnormalRateEntity.findOne({
+            new_date: new_date,
+            hour: hour,
+            task_id: task_id
+          });
+          if (AbnormalRateEntity) {
+            await this.ShuyouAbnormalRateEntity
+              .createQueryBuilder()
+              .update()
+              .set(rateObj)
+              .where('new_date = :new_date and hour = :hour and task_id = :task_id', {
+                new_date: new_date,
+                hour: hour,
+                task_id: task_id
+              })
+              .execute();
+          } else {
+            await this.ShuyouAbnormalRateEntity
+              .createQueryBuilder()
+              .insert()
+              .into(ShuyouAbnormalRateEntity)
+              .values(rateObj)
+              .execute();
+          }
+        } else {
+          // return 'syncAbnormalRate  Fail>>> 2' + updateTime;
+        }
+      }
+    })
+
+
+
+    // ====================================
+
+    return 'syncAbnormalRate  SUCCESS>>>' + updateTime;
+  }
+
+  /**
+   *
+   * 快速批量查询游戏异常率
+   * @return {*} 
+   * @memberof XjfLogTaskService
+   */
+  async syncAbnormalRateByBatch() {
+    let new_date = this.utils.formatDate(new Date())
+    let hour = new Date().getHours()
+    // console.log(hour)
+    let updateTime = new Date()
+    this.logger.info('syncAbnormalRateByBatch>>>' + updateTime);
+
+    const sql = `
+      SELECT
+        a.task_id,
+        a.task_name,
+        a.new_date,
+        a.directorId,
+        b.login_modeId,
+        b.xjf_id
+      from 
+        shuyou_game_target a
+        LEFT JOIN shuyou_game_task b ON a.task_id = b.id
+      where 1 = 1 
+      ${this.setSql(new_date, 'and a.new_date = ? ORDER BY a.task_id', [new_date])}
+    `;
+    // console.log(sql)
+    const targetList = await this.nativeQuery(sql);
+    if (_.isEmpty(targetList)) {
+      return 'syncAbnormalRateByBatch >>> shuyou_game_target is null >>> ' + updateTime;
+    }
+    // this.logger.info(targetList)
+    const logs = [
+      { action: '教程主线', action_result: '冻结' },
+      { action: '拉取账号', action_result: '成功' },
+      { action: '启动模拟器', action_result: '成功' },
+      { action: '启动游戏', action_result: '查询IP' },
+      { action: '脚本启动', action_result: '成功' },
+      { action: '启动游戏', action_result: '成功' },
+      { action: '登陆', action_result: '成功' },
+      { action: '教程主线', action_result: '进入游戏' },
+      { action: '教程主线', action_result: '新增成功' },
+      { action: '教程主线', action_result: '留存成功' },
+      { action: '付费充值', action_result: '付费成功' },
+      { action: '教程主线', action_result: '可以付费' },
+      { action: '留存账号总数', action_result: '留存账号总数' },
+      { action: '询问付费', action_result: '付费' }
+    ]
+
+    let data3 = await queryNewComputerRoom(new_date)
+    let newComputerRoomData = []
+    if (_.isEmpty(data3) || data3 == -1) {
+      // this.logger.warn('新机房后台数据错误')
+      newComputerRoomData = []
+    } else {
+      newComputerRoomData = JSON.parse(data3 + '')
+    }
+
+    let num_arr0 = []
+    let num_arr1 = []
+    let num_arr2 = []
+    let num_arr3 = []
+    let num_arr4 = []
+    let num_arr5 = []
+    let num_arr6 = []
+    let num_arr7 = []
+    let num_arr8 = []
+    let num_arr9 = []
+    let num_arr10 = []
+    let num_arr11 = []
+    let num_arr12 = []
+    let num_arr13 = []
+    //查询所有日志结果start===============
+    await ykhForeach(logs, async (e, i) => {
+      const action = e.action
+      const action_result = e.action_result
+
+      let arr_i
+      if (i == 6) {
+        //小绵羊登录 小绵羊登陆
+        arr_i = await queryXjfLogByBatch(new_date, '小绵羊登录', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        arr_i = await queryXjfLogByBatch(new_date, '小绵羊登陆', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        //魅族登录 魅族登陆
+        arr_i = await queryXjfLogByBatch(new_date, '魅族登录', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        arr_i = await queryXjfLogByBatch(new_date, '魅族登陆', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        //QQ登录 QQ登陆 微信登录 微信登陆
+        arr_i = await queryXjfLogByBatch(new_date, 'QQ登录', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+
+        arr_i = await queryXjfLogByBatch(new_date, '微信登录', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        arr_i = await queryXjfLogByBatch(new_date, 'QQ登陆', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        arr_i = await queryXjfLogByBatch(new_date, '微信登陆', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        //网易登录 网易登陆
+        arr_i = await queryXjfLogByBatch(new_date, '网易登录', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+        arr_i = await queryXjfLogByBatch(new_date, '网易登陆', action_result)
+        if (arr_i != 'null') {
+          num_arr6.push(...JSON.parse(arr_i + ''))
+        }
+      } else {
+        arr_i = await queryXjfLogByBatch(new_date, action, action_result)
+      }
+      if (arr_i != 'null') {
+        switch (i) {
+          case 0: num_arr0.push(arr_i)
+            break;
+          case 1: num_arr1.push(arr_i)
+            break;
+          case 2: num_arr2.push(arr_i)
+            break;
+          case 3: num_arr3.push(arr_i)
+            break;
+          case 4: num_arr4.push(arr_i)
+            break;
+          case 5: num_arr5.push(arr_i)
+            break;
+          case 7: num_arr7.push(arr_i)
+            break;
+          case 8: num_arr8.push(arr_i)
+            break;
+          case 9: num_arr9.push(arr_i)
+            break;
+          case 10: num_arr10.push(arr_i)
+            break;
+          case 11: num_arr11.push(arr_i)
+            break;
+          case 12: num_arr12.push(arr_i)
+            break;
+          case 13: num_arr13.push(arr_i)
+            break;
+        }
+      }
+    })
+
+    if (!_.isEmpty(num_arr0)) {
+      num_arr0 = JSON.parse(num_arr0 + '')
+    }
+    if (!_.isEmpty(num_arr1)) {
+      num_arr1 = JSON.parse(num_arr1 + '')
+    }
+    if (!_.isEmpty(num_arr2)) {
+      num_arr2 = JSON.parse(num_arr2 + '')
+    }
+    if (!_.isEmpty(num_arr3)) {
+      num_arr3 = JSON.parse(num_arr3 + '')
+    }
+    if (!_.isEmpty(num_arr4)) {
+      num_arr4 = JSON.parse(num_arr4 + '')
+    }
+    if (!_.isEmpty(num_arr5)) {
+      num_arr5 = JSON.parse(num_arr5 + '')
+    }
+    if (!_.isEmpty(num_arr7)) {
+      num_arr7 = JSON.parse(num_arr7 + '')
+    }
+    if (!_.isEmpty(num_arr8)) {
+      num_arr8 = JSON.parse(num_arr8 + '')
+    }
+    if (!_.isEmpty(num_arr9)) {
+      num_arr9 = JSON.parse(num_arr9 + '')
+    }
+    if (!_.isEmpty(num_arr10)) {
+      num_arr10 = JSON.parse(num_arr10 + '')
+    }
+    if (!_.isEmpty(num_arr11)) {
+      num_arr11 = JSON.parse(num_arr11 + '')
+    }
+    if (!_.isEmpty(num_arr12)) {
+      num_arr12 = JSON.parse(num_arr12 + '')
+    }
+    if (!_.isEmpty(num_arr13)) {
+      num_arr13 = JSON.parse(num_arr13 + '')
+    }
+
+    //查询所有日志结果end ===============
+    //遍历游戏表
+    await ykhForeach(targetList, async (target) => {
+      let task_id = target.task_id
+      let task_name = target.task_name
+      let directorId = target.directorId
+      // let login_modeId = target.login_modeId
+      let xjf_id = target.xjf_id
+      // console.log(xjf_id)
+      let num_frozen = 0
+      let num_pull_account = 0
+      let num_start_simulator = 0
+      let num_ip = 0
+      let num_start_script = 0
+      let num_start_game = 0
+      let num_login_success = 0
+      let num_into_game = 0
+      let num_new_success = 0
+      let num_lc_success = 0
+      let num_pay_success = 0
+      let rate_all_step = 0
+      let num_could_pay = 0 // 可以付费的账号
+      let num_account_lc = 0  //留存账号总数
+      let num_pull_pay = 0  // 下发付费账号
+      let order_success_rate = '-/-/-%'
+
+      for (let num of num_arr0) {
+        if (xjf_id == num.game_id) {
+          num_frozen = num.total
+          break;
+        }
+      }
+
+      for (let num of num_arr1) {
+        if (xjf_id == num.game_id) {
+          // this.logger.info(num)
+          num_pull_account = num.total
+          break;
+        }
+      }
+      for (let num of num_arr2) {
+        if (xjf_id == num.game_id) {
+          num_start_simulator = num.total
+          break;
+        }
+      }
+      for (let num of num_arr3) {
+        if (xjf_id == num.game_id) {
+          num_ip = num.total
+          break;
+        }
+      }
+      for (let num of num_arr4) {
+        if (xjf_id == num.game_id) {
+          num_start_script = num.total
+          break;
+        }
+      }
+      for (let num of num_arr5) {
+        if (xjf_id == num.game_id) {
+          num_start_game = num.total
+          break;
+        }
+      }
+      for (let num of num_arr6) {
+        if (xjf_id == num.game_id) {
+          num_login_success = num_login_success + num.total
+        }
+      }
+      for (let num of num_arr7) {
+        if (xjf_id == num.game_id) {
+          num_into_game = num.total
+          break;
+        }
+      }
+      for (let num of num_arr8) {
+        if (xjf_id == num.game_id) {
+          num_new_success = num.total
+          break;
+        }
+      }
+      for (let num of num_arr9) {
+        if (xjf_id == num.game_id) {
+          num_lc_success = num.total
+          break;
+        }
+      }
+      for (let num of num_arr10) {
+        if (xjf_id == num.game_id) {
+          num_pay_success = num.total
+          break;
+        }
+      }
+      for (let num of num_arr11) {
+        if (xjf_id == num.game_id) {
+          num_could_pay = num.total
+          break;
+        }
+      }
+      for (let num of num_arr12) {
+        if (xjf_id == num.game_id) {
+          num_account_lc = num.total
+          break;
+        }
+      }
+      for (let num of num_arr13) {
+        if (xjf_id == num.game_id) {
+          num_pull_pay = num.total
+          break;
+        }
+      }
+
+      if (num_into_game != 0 && num_start_game != 0) {
+        rate_all_step = parseFloat(num_into_game + '') / parseFloat(num_start_game + '')
+      }
+      //
+      for (let new_value of newComputerRoomData) {
+        if (new_value.game_id == xjf_id) {
+          order_success_rate = new_value.order_success_rate
+          break;
+        }
+      }
+
+      let rateObj = {
+        task_id: task_id,
+        task_name: task_name,
+        directorId: directorId,
+        new_date: new_date,
+        hour: hour,
+        num_frozen: num_frozen,
+        num_pull_account: num_pull_account,
+        num_start_simulator: num_start_simulator,
+        num_ip: num_ip,
+        num_start_script: num_start_script,
+        num_start_game: num_start_game,
+        num_login_success: num_login_success,
+        num_into_game: num_into_game,
+        num_new_success: num_new_success,
+        num_lc_success: num_lc_success,
+        num_pay_success: num_pay_success,
+        rate_all_step: rate_all_step,
+        num_could_pay: num_could_pay,  // 可以付费的账号
+        num_account_lc: num_account_lc,  //留存账号总数
+        num_pull_pay: num_pull_pay,  // 下发付费账号
+        order_success_rate: order_success_rate
+      }
+      // console.log(rateObj)
+      const AbnormalRateEntity = await this.ShuyouAbnormalRateEntity.findOne({
+        new_date: new_date,
+        hour: hour,
+        task_id: task_id
+      });
+      if (AbnormalRateEntity) {
+        await this.ShuyouAbnormalRateEntity
+          .createQueryBuilder()
+          .update()
+          .set(rateObj)
+          .where('new_date = :new_date and hour = :hour and task_id = :task_id', {
+            new_date: new_date,
+            hour: hour,
+            task_id: task_id
+          })
+          .execute();
+      } else {
+        await this.ShuyouAbnormalRateEntity
+          .createQueryBuilder()
+          .insert()
+          .into(ShuyouAbnormalRateEntity)
+          .values(rateObj)
+          .execute();
+      }
+    })
+    // ====================================
+    this.logger.info('syncAbnormalRateByBatch SUCCESS>>>' + updateTime);
+    return 'syncAbnormalRateByBatch  SUCCESS>>>' + updateTime;
+  }
+
+  /**
+   * 定时查询QQ卡剩余张数,少于5张,则报警
+   *
+   * @memberof XjfLogTaskService
+   */
+  async queryQQCardCount() {
+    let updateTime = new Date()
+    let data
+    data = await queryQQCardCount()
+    // console.log('data:' + data)
+    let text = ''
+    if (parseInt(data + '') < 5) {
+      // console.log('QQ卡即将用尽')
+      text = ">##### QQ卡即将用尽,请及时补充,当前剩余" + data + " \n"
+      await this.shuyouUtilsService.postRobotEnterpriseWeChat3(text)
+    }
+    data = await queryMzBalance()
+    // console.log('data:' + data)
+    if (parseInt(data + '') <= 500) {
+      // console.log('QQ卡即将用尽')
+      text = ">##### 魅族云点即将用尽,请及时补充,当前剩余" + data + " \n"
+      await this.shuyouUtilsService.postRobotEnterpriseWeChat3(text)
+    }
+
+    return 'queryQQCardCount  SUCCESS>>>' + updateTime;
+  }
+
+
+
+
+
+}
+
+//==========================================================================================
+// 根据gameid获取新机房信息
+let queryXjfId = function (game_id) {
+  var url = 'http://xjf.lianyou.fun:8099/v1/task_statistics/get_data_id?game_id=' + game_id
+  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 = 'http://xjf.lianyou.fun:8099/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 queryXjfLog = function (new_date, action, action_result, game_id) {
+  var url = 'http://xjf.lianyou.fun:8099/v1/device/get_log?date=' + new_date + '&action=' + action + '&action_result=' + action_result + '&game_id=' + game_id
+  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 queryXjfLogByBatch = function (new_date, action, action_result) {
+  var url = 'http://xjf.lianyou.fun:8099/v1/device/get_log_by_game?date=' + new_date + '&action=' + action + '&action_result=' + action_result
+  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;
+}
+// 获取QQ卡剩余张数
+let queryQQCardCount = function () {
+  var url = 'http://xjf.lianyou.fun:8099/v1/device/qq_card_count'
+  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 queryMzBalance = function () {
+  var url = 'http://xjf.lianyou.fun:8099/v1/device/setAccountLog?action=付费充值&action_result=查询魅族云点&account=meizu'
+  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;
+}
+
+// foreach加上async/await
+const ykhForeach = async (arr, callback) => {
+  const length = arr.length;
+  const O = Object(arr);
+  let k = 0;
+  while (k < length) {
+    if (k in O) {
+      // console.log('doing foreach...');
+      const kValue = O[k];
+      await callback(kValue, k, O);
+    }
+    k++;
+  }
+};

+ 3 - 3
cool-admin-midway-master/src/config/config.default.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-08 10:26:27
- * @LastEditTime: 2022-04-15 15:49:30
+ * @LastEditTime: 2022-08-03 10:46:31
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\config\config.default.ts
  */
@@ -24,7 +24,7 @@ export default (appInfo: EggAppInfo) => {
     formLimit: '20mb',
     jsonLimit: '20mb',
     textLimit: '20mb'
-    // 值的大小可以根据自己的需求修改 这里只做演示
+    // 值的大小可以根据自己的需求修改 
   }
 
   // 模板渲染 用法 https://nunjucks.bootcss.com
@@ -76,7 +76,7 @@ export default (appInfo: EggAppInfo) => {
     // 分页配置
     page: {
       // 分页查询每页条数
-      size: 30,
+      size: 40,
     },
     // 文件上传
     file: {

+ 2 - 2
cool-admin-midway-master/src/welcome.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-08 10:26:26
- * @LastEditTime: 2022-04-15 15:49:49
+ * @LastEditTime: 2022-08-02 15:08:55
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-midway-master\src\welcome.ts
  */
@@ -20,6 +20,6 @@ export class WelcomeController extends BaseController {
 
   @Get('/')
   public async welcome() {
-    await this.ctx.render('welcome', { text: 'HELLO COOL-ADMIN 3.2.2' });
+    await this.ctx.render('welcome', { text: 'HELLO COOL-ADMIN 3.5.1' });
   }
 }

+ 7 - 45
cool-admin-vue-vue3-ts-vite/README.md

@@ -1,50 +1,12 @@
+<!--
+ * @Author: YKH
+ * @Date: 2021-12-08 10:26:27
+ * @LastEditTime: 2022-08-03 11:17:51
+ * @Description: 
+ * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\README.md
+-->
 # cool-admin [vue3 - ts - vite]
 
-<p align="center">
-  <a href="https://show.cool-admin.com/" target="blank"><img src="https://admin.cool-js.com/logo.png" width="200" alt="cool-admin Logo" /></a>
-</p>
-
-<p align="center">cool-admin 一个很酷的后台权限管理系统,开源免费,模块化、插件化、极速开发 CRUD,方便快速构建迭代后台管理系统, 到论坛 进一步了解</p>
-
-<p align="center">
-    <a href="https://github.com/cool-team-official/cool-admin-vue/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="GitHub license" />
-    <a href=""><img src="https://img.shields.io/github/package-json/v/cool-team-official/cool-admin-vue?style=flat-square" alt="GitHub tag"></a>
-    <img src="https://img.shields.io/github/last-commit/cool-team-official/cool-admin-vue?style=flat-square" alt="GitHub tag"></a>
-</p>
-
-## 地址
-
--   [⚡️ vue2.x + element-ui](https://github.com/cool-team-official/cool-admin-vue)
-
--   [⚡️ vue3.x + element-plus + ts + webpack](https://github.com/cool-team-official/cool-admin-vue/tree/vue3-ts-webpack)
-
--   [📌 vue3.x + element-plus + ts + vite](https://github.com/cool-team-official/cool-admin-vue/tree/vue3-ts-vite)
-
--   [🌐 码云仓库地址](https://gitee.com/cool-team-official/cool-admin-vue)
-
-## 演示
-
-[https://show.cool-admin.com](https://show.cool-admin.com)
-
-账户:admin,密码:123456
-
-<img src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/home-mini.png" alt="Admin Home" ></a>
-
-## 项目后端
-
-[https://github.com/cool-team-official/cool-admin-midway](https://github.com/cool-team-official/cool-admin-midway)
-
-## 微信群
-
-<img width="260" src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/wechat.jpeg" alt="Admin Wechat"></a>
-
-## 微信公众号
-
-<img width="260" src="https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/mp.jpg" alt="Admin Wechat"></a>
-
-## 在线社区
-
-[https://bbs.cool-js.com/](https://bbs.cool-js.com/)
 
 ## 安装项目依赖
 

cool-admin-vue-vue3-ts-vite/package-lock.json → cool-admin-vue-vue3-ts-vite/package-lock-2.json


+ 1 - 1
cool-admin-vue-vue3-ts-vite/package.json

@@ -65,4 +65,4 @@
         "vite-plugin-style-import": "^1.0.1",
         "vite-svg-loader": "^2.1.0"
     }
-}
+}

+ 4 - 2
cool-admin-vue-vue3-ts-vite/src/App.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: YKH
  * @Date: 2021-12-08 10:29:23
- * @LastEditTime: 2021-12-15 14:52:36
+ * @LastEditTime: 2022-06-24 10:32:30
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\App.vue
 -->
@@ -29,6 +29,7 @@
 import { computed, defineComponent } from "vue";
 import { ElConfigProvider } from "element-plus";
 import zhCn from "element-plus/lib/locale/lang/zh-cn";
+
 import { useStore } from "vuex";
 
 export default defineComponent({
@@ -49,7 +50,8 @@ export default defineComponent({
 });
 </script>
 
-<style lang="scss" src="./assets/css/index.scss"></style>
+<style lang="scss" src="./assets/css/index.scss">
+</style>
 
 <style lang="scss" scoped>
 .preload {

+ 3 - 4
cool-admin-vue-vue3-ts-vite/src/assets/css/element-variables.scss

@@ -3,11 +3,10 @@ $--color-success: $color-success;
 $--color-danger: $color-danger;
 $--color-warning: $color-warning;
 $--color-info: $color-info;
-
 $--font-path: "element-plus/lib/theme-chalk/fonts";
-
 // 动态主题色,开发时可注释,会影响页面加载速度
 @import "element-plus/packages/theme-chalk/src/index";
-
+//2.2.6版本引入方法
+// @import 'element-plus/theme-chalk/src/index';
 // 默认主题色
-// @import "element-plus/lib/theme-chalk/index.css";
+// @import "element-plus/lib/theme-chalk/index.css";

+ 1 - 1
cool-admin-vue-vue3-ts-vite/src/config/env.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: YKH
  * @Date: 2021-12-08 10:29:23
- * @LastEditTime: 2021-12-19 14:55:14
+ * @LastEditTime: 2022-07-06 17:59:36
  * @Description: 
  * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\config\env.ts
  */

+ 11 - 1
cool-admin-vue-vue3-ts-vite/src/cool/modules/base/pages/error-page/components/error-page.vue

@@ -2,7 +2,7 @@
 	<div class="error-page">
 		<h1 class="code">{{ code }}</h1>
 		<p class="desc">{{ desc }}</p>
-
+		<!-- <div class="login_panle_right" /> -->
 		<template v-if="token || isLogout">
 			<div class="router">
 				<el-select v-model="url" size="small" filterable prefix-icon="el-icon-search">
@@ -166,5 +166,15 @@ export default defineComponent({
 		width: 100%;
 		text-align: center;
 	}
+
+	// .login_panle_right {
+	// 	background-image: url("../../../../../../assets/icon/bg/404\ Error\ with\ a\ cute\ animal-rafiki.svg");
+	// 	background-size: 100% 100%;
+	// 	height: 500px;
+	// 	width: 800px;
+	// 	background-repeat: no-repeat;
+	// }
+
+
 }
 </style>

+ 6 - 13
cool-admin-vue-vue3-ts-vite/src/cool/modules/chat/components/chat.vue

@@ -1,19 +1,12 @@
 <template>
 	<div class="cl-chat__wrap">
 		<!-- 聊天窗口 -->
-		<cl-dialog
-			v-model="visible"
-			:title="title"
-			:height="height"
-			:width="width"
-			:props="{
-				modal: true,
-				customClass: 'cl-chat__dialog',
-				'append-to-body': true,
-				'close-on-click-modal': false
-			}"
-			:controls="['slot-session', 'cl-flex1', 'fullscreen', 'close']"
-		>
+		<cl-dialog v-model="visible" :title="title" :height="height" :width="width" :props="{
+			modal: true,
+			customClass: 'cl-chat__dialog',
+			'append-to-body': true,
+			'close-on-click-modal': false
+		}" :controls="['slot-session', 'cl-flex1', 'fullscreen', 'close']">
 			<div class="cl-chat">
 				<!-- 会话列表 -->
 				<chat-session />

+ 0 - 110
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/adv-search-target.vue

@@ -1,110 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:00:37
- * @LastEditTime: 2022-04-24 11:17:10
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\adv-search-target.vue
--->
-<template>
-	<div class="demo-adv-search-target">
-		<cl-adv-btn>搜索</cl-adv-btn>
-		<cl-adv-search :items="items" :op-list="opList" />
-	</div>
-</template>
-
-<script lang="ts">
-import { AdvSearchItem } from "cl-admin-crud-vue3/types";
-import { defineComponent, ref } from "vue";
-// import dayjs from "dayjs";
-
-export default defineComponent({
-	setup() {
-		const items = ref<AdvSearchItem[]>([
-			{
-				prop: "new_date",
-				label: "目标日期",
-				span: 18,
-				component: {
-					name: "el-date-picker",
-					props: {
-						type: "daterange",
-						rangeSeparator: "至",
-						startPlaceholder: "开始日期",
-						endPlaceholder: "结束日期",
-						format: "YYYY-MM-DD",
-						valueFormat: "YYYY-MM-DD"
-					}
-				},
-				rules: {
-					required: true,
-					message: "日期不能为空"
-				}
-			},
-			{
-				label: "任务ID",
-				prop: "task_id",
-				span: 13,
-				component: {
-					name: "el-input",
-					attrs: {
-						placeholder: "请填写任务ID"
-					}
-				}
-			},
-			{
-				label: "任务名称",
-				prop: "task_name",
-				span: 18,
-				component: {
-					name: "el-input",
-					attrs: {
-						placeholder: "请填写任务名称"
-					}
-				}
-			},
-			{
-				prop: "game_agentId",
-				label: "游戏厂商",
-				span: 13,
-				component: {
-					name: "hideGameAgentselect",
-					props: {
-						placeholder: "请选择游戏厂商"
-					}
-				}
-			},
-			{
-				prop: "login_modeId",
-				label: "登录方式",
-				span: 13,
-				component: {
-					name: "hideLoModeselect",
-					props: {
-						placeholder: "请选择登录方式"
-					}
-				}
-			},
-			{
-				prop: "directorId",
-				label: "负责人",
-				span: 13,
-				component: {
-					name: "hideGameDirectorselect",
-					props: {
-						placeholder: "请选择负责人"
-					}
-				}
-			}
-		]);
-
-		const opList = ref<string[]>(["search", "reset", "clear", "close"]);
-
-		return {
-			items,
-			opList
-		};
-	}
-});
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 121
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/adv-search.vue

@@ -1,121 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:00:46
- * @LastEditTime: 2022-04-24 11:16:44
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\adv-search.vue
--->
-<template>
-	<div class="demo-adv-search">
-		<cl-adv-btn>筛选</cl-adv-btn>
-		<cl-adv-search :items="items" :op-list="opList" />
-	</div>
-</template>
-
-<script lang="ts">
-import { AdvSearchItem } from "cl-admin-crud-vue3/types";
-import { defineComponent, ref } from "vue";
-
-export default defineComponent({
-	setup() {
-		const items = ref<AdvSearchItem[]>([
-			{
-				label: "任务ID",
-				prop: "id",
-				span: 24,
-				component: {
-					name: "el-input",
-					attrs: {
-						placeholder: "请填写任务ID"
-					}
-				}
-			},
-			{
-				label: "任务名称",
-				prop: "task_name",
-				span: 24,
-				component: {
-					name: "el-input",
-					attrs: {
-						placeholder: "请填写任务名称"
-					}
-				}
-			},
-			{
-				prop: "directorId",
-				label: "负责人",
-				span: 12,
-				component: {
-					name: "hideGameDirectorselect",
-					props: {
-						placeholder: "请选择负责人"
-					}
-				}
-			},
-			{
-				prop: "game_agentId",
-				label: "游戏端口",
-				span: 12,
-				group: "base",
-				component: {
-					name: "hideGameAgentselect",
-					props: {
-						placeholder: "请选择游戏端口"
-					}
-				}
-			},
-			{
-				prop: "account_typeId",
-				label: "账号类型",
-				span: 12,
-				group: "base",
-				component: {
-					name: "hideAccountTypeselect",
-					props: {
-						placeholder: "请选择账号类型"
-					}
-				}
-			},
-			{
-				prop: "login_modeId",
-				label: "登录方式",
-				span: 12,
-				group: "base",
-				component: {
-					name: "hideLoModeselect",
-					props: {
-						placeholder: "请选择登录方式"
-					}
-				}
-			},
-			{
-				label: "是否执行",
-				prop: "is_run",
-				value: 1,
-				component: {
-					name: "el-radio-group",
-					options: [
-						{
-							label: "开启",
-							value: 1
-						},
-						{
-							label: "关闭",
-							value: 0
-						}
-					]
-				}
-			}
-		]);
-
-		const opList = ref<string[]>(["search", "reset", "clear", "close"]);
-
-		return {
-			items,
-			opList
-		};
-	}
-});
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 65
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideAccountType-select.vue

@@ -1,65 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2021-12-08 10:29:23
- * @LastEditTime: 2022-04-24 10:59:17
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideAccountType-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" @change="onChange">
-		<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.name" />
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-// import { isArray } from "/@/core/utils";
-
-export default defineComponent({
-	name: "hideAccountTypeselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val; //(isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideAccountType.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 65
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameAgent-select.vue

@@ -1,65 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:02:09
- * @LastEditTime: 2022-04-24 14:03:28
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideGameAgent-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" @change="onChange">
-		<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.name" />
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-import { isArray } from "/@/core/utils";
-
-export default defineComponent({
-	name: "hideGameAgentselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val; //(isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideGameAgent.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 66
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameDirector-select.vue

@@ -1,66 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:02:09
- * @LastEditTime: 2022-04-24 11:30:41
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideGameDirector-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" @change="onChange">
-		<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.name" />
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-
-export default defineComponent({
-	name: "hideGameDirectorselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			// alert(val)
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val;
-				//value.value =  (isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideGameDirector.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 71
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameDirectorName-select.vue

@@ -1,71 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:02:09
- * @LastEditTime: 2022-04-24 14:03:35
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideGameDirectorName-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" @change="onChange">
-		<el-option
-			v-for="(item, index) in list"
-			:key="index"
-			:value="item.name"
-			:label="item.name"
-		/>
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-
-export default defineComponent({
-	name: "hideGameDirectorNameselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			// alert(val)
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val;
-				//value.value =  (isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideGameDirector.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 71
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameList-select.vue

@@ -1,71 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2021-12-23 17:04:33
- * @LastEditTime: 2022-04-24 14:03:42
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideGameList-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" multiple @change="onChange">
-		<el-option
-			v-for="(item, index) in list"
-			:key="index"
-			:value="item.id"
-			:label="item.game_name + ' ' + item.game_agent + ' ' + item.login_mode"
-		/>
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-import { isArray } from "/@/core/utils";
-
-export default defineComponent({
-	name: "hideGameListSelect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				// value.value = val;
-				value.value = (isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideGameList.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 65
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideGameTask-select.vue

@@ -1,65 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:02:09
- * @LastEditTime: 2022-04-24 14:03:49
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideGameTask-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" filterable placeholder="Select" @change="onChange">
-		<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.id" />
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-import { isArray } from "/@/core/utils";
-
-export default defineComponent({
-	name: "hideGameTaskselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val; //(isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideGameTask.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 65
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/hideLoMode-select.vue

@@ -1,65 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:02:09
- * @LastEditTime: 2022-04-24 14:03:56
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\hideLoMode-select.vue
--->
-<template>
-	<el-select v-model="value" v-bind="props" @change="onChange">
-		<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.name" />
-	</el-select>
-</template>
-
-<script lang="ts">
-import { defineComponent, inject, onMounted, ref, watch } from "vue";
-import { isArray } from "/@/core/utils";
-
-export default defineComponent({
-	name: "hideLoModeselect",
-
-	props: {
-		modelValue: [String, Number, Array],
-		props: Object
-	},
-
-	emits: ["update:modelValue"],
-
-	setup(props, { emit }) {
-		// 请求服务
-		const service = inject<any>("service");
-
-		// 数据列表
-		const list = ref<any[]>([]);
-
-		// 绑定值
-		const value = ref<any>();
-
-		// 绑定值回调
-		function onChange(val: any) {
-			emit("update:modelValue", val);
-		}
-
-		// 解析值
-		watch(
-			() => props.modelValue,
-			(val: any) => {
-				value.value = val; //(isArray(val) ? val : [val]).filter(Boolean);
-			},
-			{
-				immediate: true
-			}
-		);
-
-		onMounted(async () => {
-			list.value = await service.hideLoMode.list();
-		});
-
-		return {
-			list,
-			value,
-			onChange
-		};
-	}
-});
-</script>

+ 0 - 25
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/index.ts

@@ -1,25 +0,0 @@
-/*
- * @Author: YKH
- * @Date: 2022-04-21 17:28:59
- * @LastEditTime: 2022-04-24 11:19:15
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\index.ts
- */
-
-import hideGameAgentselect from "./hideGameAgent-select.vue";
-import hideAccountTypeselect from "./hideAccountType-select.vue";
-import hideGameDirectorselect from "./hideGameDirector-select.vue";
-import hideLoModeselect from "./hideLoMode-select.vue";
-import hideGameTaskselect from "./hideGameTask-select.vue";
-import hideGameDirectorNameselect from "./hideGameDirectorName-select.vue";
-import hideGameListSelect from "./hideGameList-select.vue";
-
-export default {
-    hideGameAgentselect,
-    hideAccountTypeselect,
-    hideGameDirectorselect,
-    hideLoModeselect,
-    hideGameTaskselect,
-    hideGameDirectorNameselect,
-    hideGameListSelect
-};

+ 0 - 45
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/components/query-isfinish.vue

@@ -1,45 +0,0 @@
-<!--
- * @Author: YKH
- * @Date: 2022-04-21 18:01:11
- * @LastEditTime: 2022-05-11 17:07:24
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\query-isfinish.vue
--->
-<!--
- * @Author: YKH
- * @Date: 2021-12-08 10:29:23
- * @LastEditTime: 2022-04-05 22:17:08
- * @Description: 
- * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\hide\components\query-isfinish.vue
--->
-<template>
-	<cl-query field="is_complete" :list="list" />
-	<!--未完成红点提示-->
-	<!-- <el-badge class="item" is-dot type="danger">
-		<span style="font-size: 10px">未完成</span>
-	</el-badge> -->
-</template>
-
-<script lang="ts">
-import { QueryList } from "cl-admin-crud-vue3/types";
-import { defineComponent, ref } from "vue";
-
-export default defineComponent({
-	setup() {
-		const list = ref<QueryList[]>([
-			{
-				label: "已完成",
-				value: 1
-			},
-			{
-				label: "未完成",
-				value: 0
-			}
-		]);
-
-		return {
-			list
-		};
-	}
-});
-</script>

+ 0 - 1
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/directives/index.ts

@@ -1 +0,0 @@
-export default {};

+ 0 - 15
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/index.ts

@@ -1,15 +0,0 @@
-import components from "./components";
-import directives from "./directives";
-import service from "./service";
-import store from "./store";
-import pages from "./pages";
-import views from "./views";
-
-export default {
-	components,
-	directives,
-	service,
-	store,
-	pages,
-	views
-};

+ 0 - 0
cool-admin-vue-vue3-ts-vite/src/cool/modules/hide/pages/index.ts


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov