From 26d7c4cb292025dad56635dc02bf32a348ee62ef Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期三, 16 三月 2022 19:38:24 +0800
Subject: [PATCH] befor merge
---
src/app/modules/base/entity/app/commentity.ts | 889 ++++++++++++++++++++++++++++++++++++++++++++
src/app/modules/deviceGroup/controller/admin/deviceGroup.ts | 24
src/app/modules/device/controller/app/device.ts | 2
src/app/modules/device/entity/device.ts | 6
src/app/modules/base/service/dataapi/dataapi.ts | 24 +
src/app/modules/base/schedule/create_obj_entity.ts | 71 +++
src/app/modules/base/controller/admin/open.ts | 106 ++++
src/app/modules/deviceGroup/controller/app/deviceGroup.ts | 28
8 files changed, 1,107 insertions(+), 43 deletions(-)
diff --git a/src/app/modules/base/controller/admin/open.ts b/src/app/modules/base/controller/admin/open.ts
index 6e4b8ec..53816af 100644
--- a/src/app/modules/base/controller/admin/open.ts
+++ b/src/app/modules/base/controller/admin/open.ts
@@ -10,15 +10,18 @@
import { Context } from 'egg';
import { CoolController, BaseController } from '@cool-midway/core';
import { LoginDTO } from '../../dto/login';
+import * as fs from 'fs';
import { BaseSysLoginService } from '../../service/sys/login';
import { BaseSysParamService } from '../../service/sys/param';
import { DataService } from '../../service/dataapi/dataapi';
+import { CommEntity } from '../../entity/app/commentity';
/**
* 涓嶉渶瑕佺櫥褰曠殑鍚庡彴鎺ュ彛
*/
@Provide()
-@CoolController()
+@CoolController({api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+entity: CommEntity})
export class BaseOpenController extends BaseController {
@Inject()
baseSysLoginService: BaseSysLoginService;
@@ -27,7 +30,7 @@
baseSysParamService: BaseSysParamService;
@Inject()
- dataService: DataService;
+ dataService: DataService;
@Inject()
ctx: Context;
@@ -85,19 +88,98 @@
/**
* 鑾峰緱鏁版嵁
*/
- @Get('/getdata', { summary: '鏁版嵁鎺ュ彛' })
- async getData(@Query(ALL) params: any) {
- console.log('-------------------------------------------------------');
- console.log(params);
- return this.ok(await this.dataService.getData(params));
- }
+ @Get('/getdata', { summary: '鏁版嵁鎺ュ彛' })
+ async getData(@Query(ALL) params: any) {
+ ``
+ console.log('-------------------------------------------------------');
+ console.log(params);
+ return this.ok(await this.dataService.getData(params));
+ }
/**
* 鑾峰緱鏁版嵁
*/
- @Post('/postdata', { summary: '鏁版嵁鎺ュ彛' })
- async postData(@Query(ALL) params: any) {
- return this.ok(await this.dataService.getData(params));
- }
+ @Post('/postdata', { summary: '鏁版嵁鎺ュ彛' })
+ async postData(@Query(ALL) params: any) {
+ return this.ok(await this.dataService.getData(params));
+ }
+
+ @Get('/createEntity', {})
+ async createEntity() {
+ console.log('鐢熸垚缁煎悎瀹炰綋绫讳换鍔″紑濮嬫墽琛�');
+ const startTime = Date.now();
+ const columns = await this.dataService.getDataByNative({ "bid": "getColumns", "pageindex": "1", "pagesize": "300" }) //bid_obj_[0], query?.pageindex || null , query?.pagesize || null, query
+ // console.log(columns)
+ const columnstr = [];
+ columnstr.push(`import { EntityModel } from '@midwayjs/orm';
+ import { BaseEntity } from '@cool-midway/core';
+ import { Column, Double } from 'typeorm';
+
+ /**
+ * 缁煎悎瀹炰綋绫�
+ */
+ @EntityModel('t_sys_comm_column')
+ export class CommEntity extends BaseEntity { \n`)
+ columns.forEach(element => { //{ column_name: 'avg_task_time', data_type: 'int' },
+ //select table_name,column_name,data_type,column_type,is_nullable,column_default,ordinal_position,column_key,column_comment from view_columninfo order by table_name,column_name;
+ columnstr.push(`@Column({ comment:'${element.column_comment}', type:'${element.data_type}', default:'${element.column_default}'})\n`)
+ //varchar int text double datetime bigint enum mediumtext longtext tinyint decimal
+ let fieldType = 'string';
+ switch (element.data_type) {
+ case 'varchar':
+ fieldType = 'string'
+ break;
+ case 'text':
+ fieldType = 'string'
+ break;
+ case 'int':
+ fieldType = 'number'
+ break;
+ case 'bigint':
+ fieldType = 'number'
+ break;
+ case 'tinyint':
+ fieldType = 'number'
+ break;
+ case 'datetime':
+ fieldType = 'Date'
+ break;
+ case 'double':
+ fieldType = 'Double'
+ break;
+ case 'decimal':
+ fieldType = 'Double'
+ break;
+ default:
+ break;
+ }
+ // let fieldType = element.data_type=='varchar' ? 'string' : element.data_type=='int' ? 'number' : element.data_type=='bigint' ? 'number' : element.data_type=='tinyint' ? 'number'
+ columnstr.push(`${element.tbname}_${element.column_name}: ${fieldType};\n`)
+ columnstr.push(`\n`)
+ });
+ columnstr.push(`}`)
+ if (fs.existsSync('../entity/app/commentity.ts')) {
+ console.log(' file is exists')
+ } else {
+ console.log(' file is not exists')
+ // API
+ fs.writeFile('./src/app/modules/base/entity/app/commentity.ts',
+ columnstr.join(''), (error) => {
+ // 鍒涘缓澶辫触
+ if (error) {
+ console.log(`鍒涘缓澶辫触锛�${error}`)
+ }
+ // 鍒涘缓鎴愬姛
+ console.log(`鍒涘缓鎴愬姛锛乣)
+
+ })
+ }
+ //璇诲彇鏂囦欢鍐呭锛屽苟杞寲涓篔son瀵硅薄
+ // let userBugsJson = JSON.parse(fs.readFileSync("app/public/static/Data.json", "utf8"));
+ // //鑾峰彇Json閲宬ey涓篸ata鐨勬暟鎹�
+ // const data = userBugsJson['data'];
+ // return data;
+ console.log(`鐢熸垚缁煎悎瀹炰綋绫讳换鍔$粨鏉燂紝鑰楁椂:${Date.now() - startTime}ms`);
+ }
}
diff --git a/src/app/modules/base/entity/app/commentity.ts b/src/app/modules/base/entity/app/commentity.ts
new file mode 100644
index 0000000..2de32ec
--- /dev/null
+++ b/src/app/modules/base/entity/app/commentity.ts
@@ -0,0 +1,889 @@
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from '@cool-midway/core';
+import { Column, Double } from 'typeorm';
+
+/**
+ * 缁煎悎瀹炰綋绫�
+ */
+@EntityModel('t_sys_comm_column')
+export class CommEntity extends BaseEntity {
+ @Column({ comment: '闄勪欢鍚嶇О', type: 'varchar', default: 'null' })
+ deviceattachment_attach_name: string;
+
+ @Column({ comment: '椤哄簭缂栧彿', type: 'varchar', default: 'null' })
+ deviceattachment_attach_sort: string;
+
+ @Column({ comment: '闄勪欢绫诲瀷锛� 1-浣跨敤璇存槑 2-瀹夎浣嶇疆鐓х墖 ...', type: 'varchar', default: 'null' })
+ deviceattachment_attach_type: string;
+
+ @Column({ comment: '闄勪欢璁块棶璺緞', type: 'varchar', default: 'null' })
+ deviceattachment_attach_url: string;
+
+ @Column({ comment: '闄勪欢鎻愪緵浜�', type: 'varchar', default: 'null' })
+ deviceattachment_configurator: string;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ deviceattachment_device_id: string;
+
+ @Column({ comment: '閫昏緫ID', type: 'varchar', default: 'null' })
+ deviceattachment_logic_id: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ deviceattachment_remark: string;
+
+ @Column({ comment: '鐘舵��,1-鍚敤 0-鍋滅敤', type: 'int', default: '1' })
+ deviceattachment_status: number;
+
+ @Column({ comment: '鍒嗙粍璁剧疆浜哄憳', type: 'varchar', default: 'null' })
+ devicegroup_configurator: string;
+
+ @Column({ comment: '閫昏緫ID', type: 'varchar', default: 'null' })
+ devicegroup_logic_id: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: '鏃�' })
+ devicegroup_remark: string;
+
+ @Column({ comment: '鐘舵��', type: 'tinyint', default: '1' })
+ devicegroup_status: number;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ deviceopreraterecord_device_id: string;
+
+ @Column({ comment: '璁惧閫昏緫ID', type: 'varchar', default: 'null' })
+ deviceopreraterecord_logic_id: string;
+
+ @Column({ comment: '杩愮淮鍐呭', type: 'varchar', default: 'null' })
+ deviceopreraterecord_operate_content: string;
+
+ @Column({ comment: '杩愮淮绫诲瀷 1-宸℃ 2-缁翠慨', type: 'varchar', default: 'null' })
+ deviceopreraterecord_operate_type: string;
+
+ @Column({ comment: '杩愮淮浜哄憳', type: 'varchar', default: 'null' })
+ deviceopreraterecord_operator: string;
+
+ @Column({ comment: '闄勪欢璁块棶璺緞', type: 'varchar', default: 'null' })
+ deviceopreraterecord_pic_url: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ deviceopreraterecord_remark: string;
+
+ @Column({ comment: '鐘舵��,1-鍚敤 0-鍋滅敤', type: 'int', default: '1' })
+ deviceopreraterecord_status: number;
+
+ @Column({ comment: '楂樺害', type: 'double', default: '40' })
+ basedeviceinfo_altitude: Double;
+
+ @Column({ comment: '璐﹀彿', type: 'varchar', default: 'admin' })
+ basedeviceinfo_device_account: string;
+
+ @Column({ comment: '鐗╃悊ID', type: 'varchar', default: 'null' })
+ basedeviceinfo_device_id: string;
+
+ @Column({ comment: '绔彛', type: 'varchar', default: '8001' })
+ basedeviceinfo_device_port: string;
+
+ @Column({ comment: '瀵嗙爜', type: 'varchar', default: '123456' })
+ basedeviceinfo_device_psw: string;
+
+ @Column({ comment: '璁惧灏哄', type: 'varchar', default: '110*110' })
+ basedeviceinfo_dimension: string;
+
+ @Column({ comment: '鑸悜瑙�', type: 'varchar', default: '90' })
+ basedeviceinfo_heading_angle: string;
+
+ @Column({ comment: 'IP鍦板潃', type: 'varchar', default: '127.0.0.1' })
+ basedeviceinfo_ipaddress: string;
+
+ @Column({ comment: '绾害', type: 'double', default: '31' })
+ basedeviceinfo_latitude: Double;
+
+ @Column({ comment: '瀹夎浣嶇疆', type: 'varchar', default: '鍗庤兘鐢靛巶浜屽彿鐓ゆ-绗竴椹亾-鍖�' })
+ basedeviceinfo_location: string;
+
+ @Column({ comment: '閫昏緫ID', type: 'varchar', default: 'null' })
+ basedeviceinfo_logic_id: string;
+
+ @Column({ comment: '缁忓害', type: 'double', default: '121' })
+ basedeviceinfo_longitude: Double;
+
+ @Column({ comment: '璁惧鍚嶇О', type: 'varchar', default: '鍙鍏�-姣背娉�-閲囬泦璁惧' })
+ basedeviceinfo_name: string;
+
+ @Column({ comment: '杩愮淮璐熻矗浜�', type: 'varchar', default: 'null' })
+ basedeviceinfo_operator: string;
+
+ @Column({ comment: '淇话瑙�', type: 'varchar', default: '90' })
+ basedeviceinfo_petch_angle: string;
+
+ @Column({ comment: '璁惧绮惧害', type: 'varchar', default: '3' })
+ basedeviceinfo_precision: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: '鏃�' })
+ basedeviceinfo_remark: string;
+
+ @Column({ comment: '妯粴瑙�', type: 'varchar', default: '90' })
+ basedeviceinfo_roll_angle: string;
+
+ @Column({ comment: '鐘舵��', type: 'int', default: '1' })
+ basedeviceinfo_status: number;
+
+ @Column({ comment: '閰嶇疆浜�', type: 'varchar', default: 'null' })
+ basedeviceparams_configurator: string;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ basedeviceparams_device_id: string;
+
+ @Column({ comment: '璁惧閫昏緫ID', type: 'varchar', default: 'null' })
+ basedeviceparams_logic_id: string;
+
+ @Column({ comment: 'key', type: 'varchar', default: 'null' })
+ basedeviceparams_param_key: string;
+
+ @Column({ comment: '鍙傛暟绫诲瀷', type: 'int', default: 'null' })
+ basedeviceparams_param_type: number;
+
+ @Column({ comment: '鍙傛暟鍊�', type: 'varchar', default: 'null' })
+ basedeviceparams_param_value: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ basedeviceparams_remark: string;
+
+ @Column({ comment: '鐘舵��,1-鍚敤 0-鍋滅敤', type: 'int', default: '1' })
+ basedeviceparams_status: number;
+
+ @Column({ comment: '閰嶇疆浜�', type: 'varchar', default: 'null' })
+ basedevicesection_configurator: string;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ basedevicesection_device_id: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ basedevicesection_remark: string;
+
+ @Column({ comment: '缁勪欢鍚嶇О', type: 'varchar', default: 'null' })
+ basedevicesection_section_name: string;
+
+ @Column({ comment: '椤哄簭缂栧彿', type: 'varchar', default: 'null' })
+ basedevicesection_section_sort: string;
+
+ @Column({ comment: '缁勪欢绫诲瀷', type: 'int', default: 'null' })
+ basedevicesection_section_type: number;
+
+ @Column({ comment: '鐘舵��,1-鍚敤 0-鍋滅敤', type: 'int', default: '1' })
+ basedevicesection_status: number;
+
+ @Column({ comment: '绫诲埆 1-蹇冭烦 2-鍛婅', type: 'int', default: 'null' })
+ basedevicestatus_alarm_type: number;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ basedevicestatus_device_id: string;
+
+ @Column({ comment: '璁惧閫昏緫ID', type: 'varchar', default: 'null' })
+ basedevicestatus_logic_id: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ basedevicestatus_remark: string;
+
+ @Column({ comment: '涓婃姤鍐呭锛屽彲浠ユ槸json鏍煎紡', type: 'varchar', default: 'null' })
+ basedevicestatus_report_content: string;
+
+ @Column({ comment: '涓婃姤鏃堕棿', type: 'datetime', default: 'null' })
+ basedevicestatus_report_time: Date;
+
+ @Column({ comment: '鐘舵��,1-鍚敤 0-鍋滅敤', type: 'int', default: '1' })
+ basedevicestatus_status: number;
+
+ @Column({ comment: '鏃嬭浆鐩村緞', type: 'varchar', default: 'null' })
+ doutrubine_diameter_wheel: string;
+
+ @Column({ comment: 'dou_wheel_volumn', type: 'varchar', default: 'null' })
+ doutrubine_dou_wheel_volumn: string;
+
+ @Column({ comment: 'max_reclaiming', type: 'varchar', default: 'null' })
+ doutrubine_max_reclaiming: string;
+
+ @Column({ comment: '鐓ゅ爢2', type: 'varchar', default: 'null' })
+ doutrubine_max_windrow: string;
+
+ @Column({ comment: 'petch_angle', type: 'varchar', default: 'null' })
+ doutrubine_petch_angle: string;
+
+ @Column({ comment: '鏃嬭浆鐩村緞', type: 'varchar', default: 'null' })
+ doutrubine_pie_height_down: string;
+
+ @Column({ comment: '鏃嬭浆鐩村緞', type: 'varchar', default: 'null' })
+ doutrubine_pie_height_up: string;
+
+ @Column({ comment: 'rated_reclaiming', type: 'varchar', default: 'null' })
+ doutrubine_rated_reclaiming: string;
+
+ @Column({ comment: '鐓ゅ爢1', type: 'varchar', default: 'null' })
+ doutrubine_rated_windrow: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ doutrubine_remark: string;
+
+ @Column({ comment: '鐘舵��', type: 'tinyint', default: '1' })
+ doutrubine_status: number;
+
+ @Column({ comment: '鏂楄疆鏈哄悕绉�', type: 'varchar', default: 'null' })
+ doutrubine_trubine_name: string;
+
+ @Column({ comment: '鏂楄疆鏈虹紪鍙�', type: 'varchar', default: 'null' })
+ doutrubine_trubine_no: string;
+
+ @Column({ comment: '鍨嬪彿灏哄', type: 'varchar', default: 'null' })
+ doutrubine_trubine_size: string;
+
+ @Column({ comment: '鏂楄疆鏈虹被鍒�', type: 'varchar', default: 'null' })
+ doutrubine_trubine_type: string;
+
+ @Column({ comment: '楂樺害', type: 'double', default: 'null' })
+ trubinelocation_elevation: Double;
+
+ @Column({ comment: '鏂逛綅瑙�', type: 'varchar', default: 'null' })
+ trubinelocation_heading_angle: string;
+
+ @Column({ comment: '缁忓害', type: 'double', default: 'null' })
+ trubinelocation_latitude: Double;
+
+ @Column({ comment: '绾害', type: 'double', default: 'null' })
+ trubinelocation_longitude: Double;
+
+ @Column({ comment: '绮惧害', type: 'varchar', default: 'null' })
+ trubinelocation_precision: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ trubinelocation_remark: string;
+
+ @Column({ comment: '1-鍚敤 0-绂佺敤', type: 'int', default: '1' })
+ trubinelocation_status: number;
+
+ @Column({ comment: '鍒嗙被ID', type: 'bigint', default: 0 })
+ baseentity_classifyId: number;
+
+ @Column({ comment: '绫诲瀷', type: 'varchar', default: 'null' })
+ baseentity_type: string;
+
+ @Column({ comment: '鍦板潃', type: 'varchar', default: 'null' })
+ baseentity_url: string;
+
+ @Column({ comment: '璐﹀彿', type: 'varchar', default: 'null' })
+ interfacelist_auth_account: string;
+
+ @Column({ comment: '瀵嗙爜', type: 'varchar', default: 'null' })
+ interfacelist_auth_psw: string;
+
+ @Column({ comment: '璁よ瘉鏂瑰紡', type: 'varchar', default: 'null' })
+ interfacelist_interface_auth: string;
+
+ @Column({ comment: '鎺ュ彛IP', type: 'varchar', default: 'null' })
+ interfacelist_interface_ip: string;
+
+ @Column({ comment: '鎺ュ彛鍚嶇О', type: 'varchar', default: 'null' })
+ interfacelist_interface_name: string;
+
+ @Column({ comment: '绔彛', type: 'varchar', default: 'null' })
+ interfacelist_interface_port: string;
+
+ @Column({ comment: '鎺ュ彛鍗忚', type: 'varchar', default: 'null' })
+ interfacelist_interface_protocal: string;
+
+ @Column({ comment: '鎺ュ彛绫诲瀷', type: 'varchar', default: 'null' })
+ interfacelist_interface_type: string;
+
+ @Column({ comment: '鎺ュ彛鍦板潃', type: 'varchar', default: 'null' })
+ interfacelist_interface_url: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ interfacelist_remark: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ interfacelist_share_service: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ interfacelist_share_url: string;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ interfacelist_status: number;
+
+ @Column({ comment: '璋冪敤缁撴潫鏃堕棿', type: 'datetime', default: 'null' })
+ interfacerecord_end_time: Date;
+
+ @Column({ comment: '鎺ュ彛璋冪敤鍦板潃', type: 'varchar', default: 'null' })
+ interfacerecord_interface_direct: string;
+
+ @Column({ comment: '鎺ュ彛娓呭崟ID', type: 'varchar', default: 'null' })
+ interfacerecord_interface_id: string;
+
+ @Column({ comment: '璋冪敤鍙傛暟锛宩son鏍煎紡', type: 'varchar', default: 'null' })
+ interfacerecord_params: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ interfacerecord_remark: string;
+
+ @Column({ comment: '璇锋眰绫诲瀷', type: 'varchar', default: 'null' })
+ interfacerecord_request_type: string;
+
+ @Column({ comment: '璋冪敤缁撴灉', type: 'varchar', default: 'null' })
+ interfacerecord_result: string;
+
+ @Column({ comment: '寮�濮嬫椂闂�', type: 'datetime', default: 'null' })
+ interfacerecord_start_time: Date;
+
+ @Column({ comment: '1-鍚敤 0-绂佺敤', type: 'int', default: '1' })
+ interfacerecord_status: number;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_citycode: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_cityEn: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_cityname: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_cloud: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_humidity: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_iconDay: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_iconNight: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_moonPhase: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_moonPhaseIcon: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_moonrise: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_moonset: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_posttime: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_precip: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_pressure: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_responsedata: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_sunrise: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_sunset: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_tempMax: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_tempMin: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_textDay: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_textNight: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_type: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_uvIndex: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_vis: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_wind360Day: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_wind360Night: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windDirDay: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windDirNight: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windScaleDay: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windScaleNight: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windSpeedDay: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherday_windSpeedNight: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_citycode: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_cityEn: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_cityname: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_cloud: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_dew: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_feelsLike: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_humidity: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_icon: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_posttime: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_precip: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_pressure: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_responsedata: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_temp: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_text: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_type: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_vis: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_wind360: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_windDir: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_windScale: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ weatherhour_windSpeed: string;
+
+ @Column({ comment: 'id', type: 'varchar', default: 'null' })
+ hnall_logic_id: string;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ comconfig_com_model_id: number;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ comconfig_model_id: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ comconfig_remark: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ comconfig_sortby: string;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ comconfig_status: number;
+
+ @Column({ comment: '鏁版嵁鍐呭', type: 'varchar', default: 'null' })
+ modelcombination_data_content: string;
+
+ @Column({ comment: '鏁版嵁鏂囦欢璺緞锛寀rl鏍煎紡锛屽煙鍚嶅彲鐢辨湇鍔$鎴栬�呭墠绔厤缃�', type: 'varchar', default: 'null' })
+ modelcombination_data_path: string;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂浠诲姟', type: 'int', default: 'null' })
+ modelcombination_is_periodic: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ modelcombination_remark: string;
+
+ @Column({ comment: '1-鍚敤 0-绂佺敤', type: 'int', default: 'null' })
+ modelcombination_status: number;
+
+ @Column({ comment: '浠诲姟ID锛屽懆鏈熶换鍔¤〃鎴栬�呭嵆鏃朵换鍔¤〃涓婚敭', type: 'int', default: 'null' })
+ modelcombination_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍ID', type: 'int', default: 'null' })
+ modelcombination_task_monitor_id: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ pointcloud_remark: string;
+
+ @Column({ comment: '鏁版嵁鍐呭', type: 'varchar', default: 'null' })
+ pointmodel_data_content: string;
+
+ @Column({ comment: '鏁版嵁鏂囦欢璺緞锛屽瓨鏀緐rl', type: 'varchar', default: 'null' })
+ pointmodel_data_path: string;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ pointmodel_device_id: string;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ pointmodel_is_periodic: number;
+
+ @Column({ comment: '鐐逛簯鏁版嵁鏉ユ簮鐨勮澶囬�昏緫缂栧彿', type: 'varchar', default: 'null' })
+ pointmodel_logic_id: string;
+
+ @Column({ comment: '鐐逛簯鍚嶇О锛屾牸寮忥細浠�${logic_id#YYYYMMDDHHMMSS}', type: 'varchar', default: 'null' })
+ pointmodel_name: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ pointmodel_remark: string;
+
+ @Column({ comment: '鐘舵�侊紝 1-鍚敤 0-绂佺敤', type: 'int', default: '1' })
+ pointmodel_status: number;
+
+ @Column({ comment: '浠诲姟ID锛屽懆鏈熶换鍔¤〃鎴栬�呭嵆鏃朵换鍔¤〃涓婚敭', type: 'int', default: 'null' })
+ pointmodel_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍id', type: 'int', default: 'null' })
+ pointmodel_task_monitor_id: number;
+
+ @Column({ comment: '鏁版嵁鍐呭', type: 'varchar', default: 'null' })
+ modelstatic_data_content: string;
+
+ @Column({ comment: '鏁版嵁鏂囦欢璺緞锛屽瓨鏀緐rl', type: 'varchar', default: 'null' })
+ modelstatic_data_path: string;
+
+ @Column({ comment: '鐗╃悊妯″瀷鐨勯�昏緫ID', type: 'varchar', default: 'null' })
+ modelstatic_logic_id: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ modelstatic_name: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ modelstatic_remark: string;
+
+ @Column({ comment: '鐘舵�侊紝 1-鍚敤 0-绂佺敤', type: 'int', default: '1' })
+ modelstatic_status: number;
+
+ @Column({ comment: '鏁版嵁鍐呭', type: 'varchar', default: 'null' })
+ colletdata_data_content: string;
+
+ @Column({ comment: '鏁版嵁瀛樺偍璺緞锛寀rl鏍煎紡锛屽煙鍚嶅彲鐢辨湇鍔$鎴栬�呭墠绔厤缃繘琛岃闂�', type: 'varchar', default: 'null' })
+ colletdata_data_path: string;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ colletdata_is_periodic: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ colletdata_remark: string;
+
+ @Column({ comment: '', type: 'int', default: '1' })
+ colletdata_status: number;
+
+ @Column({ comment: '浠诲姟ID锛屽懆鏈熶换鍔¤〃涓婚敭鎴栬�呭嵆鏃朵换鍔¤〃涓婚敭', type: 'int', default: 'null' })
+ colletdata_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍ID', type: 'int', default: 'null' })
+ colletdata_task_monitor_id: number;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ colletmeta_collet_data_id: number;
+
+ @Column({ comment: '', type: 'int', default: 'null' })
+ colletmeta_meta_data_id: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ colletmeta_remark: string;
+
+ @Column({ comment: '', type: 'int', default: '1' })
+ colletmeta_status: number;
+
+ @Column({ comment: '鏁版嵁鏂囦欢鍐呭鎻忚堪', type: 'varchar', default: 'null' })
+ metadata_data_content: string;
+
+ @Column({ comment: '鏁版嵁鏂囦欢璺緞锛寀rl鏍煎紡锛屽煙鍚嶅彲鐢卞墠绔垨鑰呮湇鍔$閰嶇疆', type: 'varchar', default: 'null' })
+ metadata_data_path: string;
+
+ @Column({ comment: '璁惧ID', type: 'varchar', default: 'null' })
+ metadata_device_id: string;
+
+ @Column({ comment: '鎵ц璁板綍', type: 'int', default: 'null' })
+ metadata_exec_record_id: number;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ metadata_is_periodic: number;
+
+ @Column({ comment: '閫昏緫ID', type: 'varchar', default: 'null' })
+ metadata_logic_id: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ metadata_remark: string;
+
+ @Column({ comment: '鐘舵�侊紝1-鏈夋晥 0-鏃犳晥 榛樿涓�1', type: 'int', default: '1' })
+ metadata_status: number;
+
+ @Column({ comment: '浠诲姟ID', type: 'int', default: 'null' })
+ metadata_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍ID', type: 'int', default: 'null' })
+ metadata_task_monitor_id: number;
+
+ @Column({ comment: '鐐逛簯璁$畻鑺辫垂鏃堕棿锛屽崟浣嶆绉�', type: 'int', default: 'null' })
+ statdata_avg_caculater_time: number;
+
+ @Column({ comment: '骞冲潎鏂囦欢澶у皬', type: 'int', default: 'null' })
+ statdata_avg_filesize: number;
+
+ @Column({ comment: '骞冲潎鑺辫垂鏃堕棿锛屽崟浣嶆绉�', type: 'int', default: 'null' })
+ statdata_avg_task_time: number;
+
+ @Column({ comment: '鏁版嵁浼犺緭鏃堕棿锛屾绉�', type: 'int', default: 'null' })
+ statdata_avg_transmission_time: number;
+
+ @Column({ comment: 'CPU 鍗犵敤鐜囷紝鐧惧垎姣�', type: 'int', default: 'null' })
+ statdata_cpu_rate: number;
+
+ @Column({ comment: '缁熻鎴鏃堕棿', type: 'datetime', default: 'null' })
+ statdata_end_time: Date;
+
+ @Column({ comment: '鍐呭瓨锛�', type: 'int', default: 'null' })
+ statdata_memory: number;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ statdata_remark: string;
+
+ @Column({ comment: '缁熻璧峰鏃堕棿', type: 'datetime', default: 'null' })
+ statdata_start_time: Date;
+
+ @Column({ comment: '', type: 'int', default: '1' })
+ statdata_status: number;
+
+ @Column({ comment: '浠诲姟绫诲瀷: 1-鎶撳浘 2-闆疯揪鎵弿 3-闄ゅ皹 ', type: 'int', default: 'null' })
+ statdata_task_type: number;
+
+ @Column({ comment: '缁熻鏃堕棿绮掑害锛�5-5鍒嗛挓 10-10鍒嗛挓 30-30鍒嗛挓 60-60鍒嗛挓 1440-1澶� 43200-1鏈� ', type: 'int', default: 'null' })
+ statdata_time: number;
+
+ @Column({ comment: '鐓ょ鏍囪', type: 'varchar', default: 'null' })
+ planinventory_coal_marker: string;
+
+ @Column({ comment: '鐓ゅ爢浣撶Н', type: 'varchar', default: 'null' })
+ planinventory_coal_volume: string;
+
+ @Column({ comment: '鐓ゅ爢閲嶉噺锛屽崟浣嶅惃', type: 'varchar', default: 'null' })
+ planinventory_coal_weight: string;
+
+ @Column({ comment: '缁勫悎鐐逛簯ID', type: 'int', default: 'null' })
+ planinventory_com_model_id: number;
+
+ @Column({ comment: '鐩樼叅璁″垝ID', type: 'int', default: 'null' })
+ planinventory_plan_id: number;
+
+ @Column({ comment: '鐩樼叅鍚嶇О', type: 'varchar', default: 'null' })
+ planinventory_plan_name: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ planinventory_remark: string;
+
+ @Column({ comment: '1-鍚敤 0-绂佺敤', type: 'int', default: '1' })
+ planinventory_status: number;
+
+ @Column({ comment: '璁惧鐗╃悊ID', type: 'varchar', default: 'null' })
+ execrecord_device_id: string;
+
+ @Column({ comment: '璁惧鎵ц浠诲姟鏃跺埢鐨勭浉鍏冲弬鏁帮紝json鏍煎紡銆�', type: 'varchar', default: 'null' })
+ execrecord_device_params: string;
+
+ @Column({ comment: '缁撴潫鏃堕棿锛屼换鍔℃墽琛屽畬鎴愭椂闂�', type: 'datetime', default: 'null' })
+ execrecord_end_time: Date;
+
+ @Column({ comment: '鎵ц缁撴灉', type: 'varchar', default: 'null' })
+ execrecord_exec_result: string;
+
+ @Column({ comment: '鎵ц鑰楁椂', type: 'varchar', default: 'null' })
+ execrecord_exec_time: string;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ execrecord_is_periodic: number;
+
+ @Column({ comment: '璁惧鐨勯�昏緫ID', type: 'varchar', default: 'null' })
+ execrecord_logic_id: string;
+
+ @Column({ comment: '鏈嶅姟绔暟鎹帴鏀舵椂闂�', type: 'datetime', default: 'null' })
+ execrecord_receive_time: Date;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ execrecord_remark: string;
+
+ @Column({ comment: '鏁版嵁鍥炰紶鏃堕棿', type: 'datetime', default: 'null' })
+ execrecord_send_time: Date;
+
+ @Column({ comment: '寮�濮嬫椂闂达紝璁惧鏀跺埌鎸囦护鏃堕棿', type: 'datetime', default: 'null' })
+ execrecord_start_time: Date;
+
+ @Column({ comment: '鏃犳剰涔夛紝妗嗘灦闇�瑕�', type: 'int', default: '1' })
+ execrecord_status: number;
+
+ @Column({ comment: '浠诲姟鎸囦护', type: 'varchar', default: 'null' })
+ execrecord_task_command: string;
+
+ @Column({ comment: '浠诲姟ID锛屽搴攖_task_periodic_setting鐨勪富閿紝鎴栬�卼_task_immediately涓婚敭', type: 'int', default: 'null' })
+ execrecord_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍ID锛屽搴攖_task_monitor鐨勪富閿�', type: 'int', default: 'null' })
+ execrecord_task_monitor_id: number;
+
+ @Column({ comment: '閫昏緫ID', type: 'varchar', default: 'null' })
+ taskimmediately_logic_ids: string;
+
+ @Column({ comment: '璁剧疆鏃堕棿', type: 'varchar', default: 'null' })
+ taskimmediately_operate_time: string;
+
+ @Column({ comment: '鎿嶄綔浜�', type: 'varchar', default: 'null' })
+ taskimmediately_operator: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ taskimmediately_remark: string;
+
+ @Column({ comment: '0-鏈墽琛� 1-鎵ц涓� 2-宸叉墽琛�', type: 'int', default: 'null' })
+ taskimmediately_status: number;
+
+ @Column({ comment: '浠诲姟鎸囦护', type: 'varchar', default: 'null' })
+ taskimmediately_task_command: string;
+
+ @Column({ comment: '浠诲姟鍐呭鎻忚堪', type: 'varchar', default: 'null' })
+ taskimmediately_task_content: string;
+
+ @Column({ comment: '浠诲姟鍙傛暟,濡傜偣浜戝弬鏁�', type: 'varchar', default: 'null' })
+ taskimmediately_task_params: string;
+
+ @Column({ comment: '浠诲姟绫诲瀷: 1-鎶撳浘 2-闆疯揪鎵弿 3-闄ゅ皹 ', type: 'int', default: 'null' })
+ taskimmediately_task_type: number;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ messagerecord_is_periodic: number;
+
+ @Column({ comment: '娑堟伅', type: 'varchar', default: 'null' })
+ messagerecord_message: string;
+
+ @Column({ comment: '鍙戦�佹簮 ', type: 'varchar', default: 'null' })
+ messagerecord_msg_source: string;
+
+ @Column({ comment: '鍙戦�佺洰鏍�', type: 'varchar', default: 'null' })
+ messagerecord_msg_target: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ messagerecord_remark: string;
+
+ @Column({ comment: '鍙戦�佹椂闂�', type: 'datetime', default: 'null' })
+ messagerecord_send_time: Date;
+
+ @Column({ comment: '娑堟伅鐘舵�� 1-宸插彂閫� 0-鏈彂閫� 榛樿涓�0', type: 'int', default: '0' })
+ messagerecord_status: number;
+
+ @Column({ comment: '浠诲姟鏉ユ簮ID', type: 'int', default: 'null' })
+ messagerecord_task_id: number;
+
+ @Column({ comment: '鐩戞祴璁板綍ID', type: 'int', default: 'null' })
+ messagerecord_task_monitor_id: number;
+
+ @Column({ comment: '鍛ㄦ湡浠诲姟鍛ㄦ湡璁剧疆锛岃皟搴﹁〃杈惧紡', type: 'varchar', default: 'null' })
+ taskmonitor_crontab_rule: string;
+
+ @Column({ comment: '1-鍛ㄦ湡浠诲姟 0-鍗虫椂鎬т换鍔�', type: 'int', default: 'null' })
+ taskmonitor_is_periodic: number;
+
+ @Column({ comment: '璁惧閫昏緫id闆嗗悎,閫楀彿鍒嗛殧', type: 'varchar', default: 'null' })
+ taskmonitor_logic_ids: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ taskmonitor_operator: string;
+
+ @Column({ comment: '', type: 'datetime', default: 'null' })
+ taskmonitor_opertate_time: Date;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ taskmonitor_remark: string;
+
+ @Column({ comment: '0-鏈墽琛� 1-鎵ц涓� 2-宸叉墽琛�', type: 'int', default: '0' })
+ taskmonitor_status: number;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ taskmonitor_task_command: string;
+
+ @Column({ comment: '', type: 'varchar', default: 'null' })
+ taskmonitor_task_content: string;
+
+ @Column({ comment: '浠诲姟ID锛� 鍛ㄦ湡浠诲姟鐨勪富閿垨鑰呮槸鍗虫椂浠诲姟鐨勪富閿�', type: 'int', default: 'null' })
+ taskmonitor_task_id: number;
+
+ @Column({ comment: '浠诲姟鍙傛暟', type: 'varchar', default: 'null' })
+ taskmonitor_task_params: string;
+
+ @Column({ comment: '浠诲姟绫诲瀷: 1-鎶撳浘 2-闆疯揪鎵弿 3-闄ゅ皹 ', type: 'int', default: 'null' })
+ taskmonitor_task_type: number;
+
+ @Column({ comment: '鍛ㄦ湡浠诲姟', type: 'varchar', default: 'null' })
+ periodicsetting_crontab_rule: string;
+
+ @Column({ comment: '浠诲姟缁撴潫鏃堕棿', type: 'datetime', default: 'null' })
+ periodicsetting_end_time: Date;
+
+ @Column({ comment: '璁惧鍒嗙粍ID', type: 'int', default: 'null' })
+ periodicsetting_group_id: number;
+
+ @Column({ comment: '璁剧疆浜�', type: 'varchar', default: 'null' })
+ periodicsetting_operator: string;
+
+ @Column({ comment: '澶囨敞', type: 'varchar', default: 'null' })
+ periodicsetting_remark: string;
+
+ @Column({ comment: '鐘舵��', type: 'tinyint', default: '1' })
+ periodicsetting_status: number;
+
+ @Column({ comment: '浠诲姟鍛戒护鏍煎紡', type: 'varchar', default: 'null' })
+ periodicsetting_task_command: string;
+
+ @Column({ comment: '浠诲姟鍐呭鎻忚堪', type: 'varchar', default: 'null' })
+ periodicsetting_task_content: string;
+
+ @Column({ comment: '浠诲姟鍙傛暟', type: 'varchar', default: 'null' })
+ periodicsetting_task_params: string;
+
+ @Column({ comment: '浠诲姟绫诲瀷', type: 'int', default: 'null' })
+ periodicsetting_task_type: number;
+
+ @Column({ comment: '骞撮緞', type: 'int', default: 'null' })
+ tuser_age: number;
+
+ @Column({ comment: '鍑虹敓鏃ユ湡', type: 'datetime', default: 'null' })
+ tuser_birthDate: Date;
+
+ @Column({ comment: '澶村儚', type: 'varchar', default: 'null' })
+ tuser_headImg: string;
+
+ @Column({ comment: '浠嬬粛', type: 'varchar', default: 'null' })
+ tuser_introduce: string;
+
+ @Column({ comment: '濮撳悕', type: 'varchar', default: 'null' })
+ tuser_name: string;
+
+ @Column({ comment: '鎬у埆 0-鏈煡 1-鐢� 2-濂�', type: 'tinyint', default: '0' })
+ tuser_type: number;
+
+}
\ No newline at end of file
diff --git a/src/app/modules/base/schedule/create_obj_entity.ts b/src/app/modules/base/schedule/create_obj_entity.ts
new file mode 100644
index 0000000..f2185bc
--- /dev/null
+++ b/src/app/modules/base/schedule/create_obj_entity.ts
@@ -0,0 +1,71 @@
+// src/schedule/hello.ts
+import { Provide, Inject, Schedule, CommonSchedule } from '@midwayjs/decorator';
+import { DataService } from '../service/dataapi/dataapi';
+import * as fs from 'fs';
+import { ILogger } from '@midwayjs/logger';
+
+/**
+ * 鏃ュ織瀹氭椂浠诲姟
+ */
+@Provide()
+@Schedule({
+ cron: '00 53 15 * * *', // 姣忓ぉ0鐐规墽琛�
+ type: 'worker', // 鎸囧畾鏌愪竴涓� worker 鎵ц
+})
+export class BaseEntitySchedule implements CommonSchedule {
+ @Inject()
+ dataService: DataService;
+
+ @Inject()
+ logger: ILogger;
+
+ // 瀹氭椂鎵ц鐨勫叿浣撲换鍔�
+ async exec() {
+ this.logger.info('鐢熸垚缁煎悎瀹炰綋绫讳换鍔″紑濮嬫墽琛�');
+ const startTime = Date.now();
+ if (fs.existsSync('../entity/app/commentity.ts')) {
+ console.log(' file is exists')
+ } else {
+ console.log(' file is not exists')
+ // API
+ fs.writeFile('./src/app/modules/base/entity/app/commentity.ts',
+ `import { EntityModel } from '@midwayjs/orm';
+ import { BaseEntity } from '@cool-midway/core';
+ import { Column } from 'typeorm';
+
+ /**
+ * 鏂囦欢绌洪棿淇℃伅
+ */
+ @EntityModel('t_sys_comm_column')
+ export class CommEntity extends BaseEntity {
+ @Column({ comment: '鍦板潃' })
+ url: string;
+
+ @Column({ comment: '绫诲瀷' })
+ type: string;
+
+ @Column({ comment: '鍒嗙被ID', type: 'bigint', nullable: true })
+ classifyId: number;
+ }`, (error) => {
+ // 鍒涘缓澶辫触
+ if(error){
+ console.log(`鍒涘缓澶辫触锛�${error}`)
+ }
+ // 鍒涘缓鎴愬姛
+ console.log(`鍒涘缓鎴愬姛锛乣)
+
+ })
+ }
+ const columns = await this.dataService.getData({"bid":"getColumns", "pageindex":"1", "pagesize":"300"}) //bid_obj_[0], query?.pageindex || null , query?.pagesize || null, query
+ console.log(columns)
+ //璇诲彇鏂囦欢鍐呭锛屽苟杞寲涓篔son瀵硅薄
+ // let userBugsJson = JSON.parse(fs.readFileSync("app/public/static/Data.json", "utf8"));
+ // //鑾峰彇Json閲宬ey涓篸ata鐨勬暟鎹�
+ // const data = userBugsJson['data'];
+ // return data;
+ this.logger.info(`鐢熸垚缁煎悎瀹炰綋绫讳换鍔$粨鏉燂紝鑰楁椂:${Date.now() - startTime}ms`);
+ }
+}
+
+
+
diff --git a/src/app/modules/base/service/dataapi/dataapi.ts b/src/app/modules/base/service/dataapi/dataapi.ts
index eeef886..e19beb7 100644
--- a/src/app/modules/base/service/dataapi/dataapi.ts
+++ b/src/app/modules/base/service/dataapi/dataapi.ts
@@ -2,6 +2,8 @@
import { BaseService, ICoolCache, } from '@cool-midway/core';
import * as _ from 'lodash';
import { MysqlUtil } from '../../utils/mysqlutil';
+// 寮曞叆璇诲啓鏍稿績妯″潡
+
/**
* 绯荤粺鐢ㄦ埛
@@ -26,12 +28,33 @@
// ); // 閮ㄩ棬鏉冮檺
const bidsql = `select * from t_sys_business_config where id_='${query.bid}' limit 0,1`;
const bid_obj_ = await this.nativeQuery(bidsql);
+ console.log(bid_obj_)
let sqlObj = this.mysqlUtil.create_sql(bid_obj_[0], query?.pageindex || null , query?.pagesize || null, query);
if (sqlObj?.status == 0) {
return sqlObj?.msg;
}
return this.sqlRenderPage(sqlObj?.sql, query);
}
+
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param query
+ */
+ async getDataByNative(query) {
+ // const { keyWord, status, departmentIds = [] } = query;
+ // const permsDepartmentArr = await this.baseSysPermsService.departmentIds(
+ // this.ctx.admin.userId
+ // ); // 閮ㄩ棬鏉冮檺
+ const bidsql = `select * from t_sys_business_config where id_='${query.bid}' limit 0,1`;
+ const bid_obj_ = await this.nativeQuery(bidsql);
+ console.log(bid_obj_)
+ let sqlObj = this.mysqlUtil.create_sql(bid_obj_[0], query?.pageindex || null , query?.pagesize || null, query);
+ if (sqlObj?.status == 0) {
+ return sqlObj?.msg;
+ }
+ return this.nativeQuery(sqlObj?.sql)
+ }
/**
* 鍒嗛〉鏌ヨ
@@ -50,6 +73,5 @@
}
return this.sqlRenderPage(sqlObj?.sql, query);
}
-
}
diff --git a/src/app/modules/device/controller/app/device.ts b/src/app/modules/device/controller/app/device.ts
index b0d5294..e519bd0 100644
--- a/src/app/modules/device/controller/app/device.ts
+++ b/src/app/modules/device/controller/app/device.ts
@@ -8,7 +8,7 @@
@Provide()
@CoolController(
{
- api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+ api: ['delete', 'update', 'info', 'list', 'page'],
entity: DemoDeviceEntity
}
)
diff --git a/src/app/modules/device/entity/device.ts b/src/app/modules/device/entity/device.ts
index 3d6e40b..f4ce258 100644
--- a/src/app/modules/device/entity/device.ts
+++ b/src/app/modules/device/entity/device.ts
@@ -5,7 +5,7 @@
/**
* 鍟嗗搧
*/
-@EntityModel('device')
+@EntityModel('t_base_deviceinfo')
export class DemoDeviceEntity extends BaseEntity {
@PrimaryGeneratedColumn({ comment: 'id' })
id: number;
@@ -22,10 +22,10 @@
@Column({ comment: '瀹夎浣嶇疆', default: "鍗庤兘鐢靛巶浜屽彿鐓ゆ-绗竴椹亾-鍖�" })
location: string;
- @Column({ comment: '缁忓害', type: 'double', default: 121.222222222 })
+ @Column({ comment: '缁忓害', type: 'double', default: 121.222222 })
longitude: number;
- @Column({ comment: '绾害', type: 'double', default: 31.222222222 })
+ @Column({ comment: '绾害', type: 'double', default: 31.222222 })
latitude: number;
@Column({ comment: '楂樺害', type: 'double', default: 40 })
diff --git a/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts b/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts
index 20bd12f..1bce6d3 100644
--- a/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts
+++ b/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts
@@ -1,13 +1,13 @@
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from '@cool-midway/core';
-import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
+// import { Provide } from '@midwayjs/decorator';
+// import { CoolController, BaseController } from '@cool-midway/core';
+// import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
-/**
- * 鎻忚堪
- */
-@Provide()
-@CoolController({
- api: ['add', 'delete', 'update', 'info', 'list', 'page'],
- entity: DemodeviceGroupEntity,
-})
-export class DemoAdmindeviceGroupController extends BaseController { }
+// /**
+// * 鎻忚堪
+// */
+// @Provide()
+// @CoolController({
+// api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+// entity: DemodeviceGroupEntity,
+// })
+// export class DemoAdmindeviceGroupController extends BaseController { }
diff --git a/src/app/modules/deviceGroup/controller/app/deviceGroup.ts b/src/app/modules/deviceGroup/controller/app/deviceGroup.ts
index 3d07128..6599c33 100644
--- a/src/app/modules/deviceGroup/controller/app/deviceGroup.ts
+++ b/src/app/modules/deviceGroup/controller/app/deviceGroup.ts
@@ -1,15 +1,15 @@
-import { Provide } from '@midwayjs/decorator';
-import { CoolController, BaseController } from '@cool-midway/core';
-import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
+// import { Provide } from '@midwayjs/decorator';
+// import { CoolController, BaseController } from '@cool-midway/core';
+// import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
-/**
- * test
- */
-@Provide()
-@CoolController(
- {
- api: ['add', 'delete', 'update', 'info', 'list', 'page'],
- entity: DemodeviceGroupEntity
- }
-)
-export class DemoAppdGController extends BaseController { }
+// /**
+// * test
+// */
+// @Provide()
+// @CoolController(
+// {
+// api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+// entity: DemodeviceGroupEntity
+// }
+// )
+// export class DemoAppdGController extends BaseController { }
--
Gitblit v1.9.1