Commit beb6224c by 胡悦

添加新增页面接口,未加搜索条件

1 parent 140579c3
/*
* @Author: huyue
* @Date: 2020-11-23 15:54:04
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:07:35
*/
"use strict";
const Controller = require("egg").Controller;
/**
* @Controller biz/collision
* @Description 碰撞预警
*/
class CollisionController extends Controller {
constructor(ctx) {
super(ctx);
this.validate = ctx.app.validator.validate;
this.request = ctx.request;
this.helper = ctx.helper;
this.redis = ctx.app.redis;
this.CollisionService = ctx.service.biz.collision;
this.ServerResponseCode = ctx.response.ServerResponseCode;
this.ServerResponse = ctx.response.ServerResponse;
}
/**
* @summary 查询所有流失预警数据
* @Router POST /biz/collision/findAll
* @Description 查询所有流失预警数据
* @Request searcher
* @Response 200 response ok
*/
async findAll({ request: { body: { pager, searcher } } }) { //get : async findAll( {query: { pager, searcher } })
const result = await this.CollisionService.findAll({ pager, searcher });
this.ctx.body = this.ServerResponse.Success(result);
}
}
module.exports = CollisionController;
/*
* @Author: huyue
* @Date: 2020-11-23 16:47:34
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:48:41
*/
"use strict";
const Controller = require("egg").Controller;
/**
* @Controller biz/fmrsdevice
* @Description 车辆资产管理服务/设备列表
*/
class FmrsdeviceController extends Controller {
constructor(ctx) {
super(ctx);
this.validate = ctx.app.validator.validate;
this.request = ctx.request;
this.helper = ctx.helper;
this.redis = ctx.app.redis;
this.FmrsdeviceService = ctx.service.biz.fmrsdevice;
this.ServerResponseCode = ctx.response.ServerResponseCode;
this.ServerResponse = ctx.response.ServerResponse;
}
/**
* @summary 查询车辆资产管理服务/设备列表
* @Router POST /biz/fmrsdevice/findAll
* @Description 查询车辆资产管理服务/设备列表
* @Request searcher
* @Response 200 response ok
*/
async findAll({ request: { body: { pager, searcher } } }) { //get : async findAll( {query: { pager, searcher } })
const result = await this.FmrsdeviceService.findAll({ pager, searcher });
this.ctx.body = this.ServerResponse.Success(result);
}
}
module.exports = FmrsdeviceController;
/*
* @Author: huyue
* @Date: 2020-11-23 16:32:21
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:34:10
*/
"use strict";
const Controller = require("egg").Controller;
/**
* @Controller biz/merchantlog
* @Description 商户登录日志
*/
class MerchantlogController extends Controller {
constructor(ctx) {
super(ctx);
this.validate = ctx.app.validator.validate;
this.request = ctx.request;
this.helper = ctx.helper;
this.redis = ctx.app.redis;
this.MerchantlogService = ctx.service.biz.merchantlog;
this.ServerResponseCode = ctx.response.ServerResponseCode;
this.ServerResponse = ctx.response.ServerResponse;
}
/**
* @summary 查询所有商户登录日志数据
* @Router POST /biz/merchantlog/findAll
* @Description 查询所有商户登录日志数据
* @Request searcher
* @Response 200 response ok
*/
async findAll({ request: { body: { pager, searcher } } }) { //get : async findAll( {query: { pager, searcher } })
const result = await this.MerchantlogService.findAll({ pager, searcher });
this.ctx.body = this.ServerResponse.Success(result);
}
}
module.exports = MerchantlogController;
/*
* @Author: huyue
* @Date: 2020-11-23 17:02:03
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 17:04:46
*/
"use strict";
const Controller = require("egg").Controller;
/**
* @Controller biz/tspdevice
* @Description AI车联网服务/设备列表
*/
class TspdeviceController extends Controller {
constructor(ctx) {
super(ctx);
this.validate = ctx.app.validator.validate;
this.request = ctx.request;
this.helper = ctx.helper;
this.redis = ctx.app.redis;
this.TspdeviceService = ctx.service.biz.tspdevice;
this.ServerResponseCode = ctx.response.ServerResponseCode;
this.ServerResponse = ctx.response.ServerResponse;
}
/**
* @summary 查询AI车联网服务/设备列表
* @Router POST /biz/tspdevice/findAll
* @Description 查询AI车联网服务/设备列表
* @Request searcher
* @Response 200 response ok
*/
async findAll({ request: { body: { pager, searcher } } }) { //get : async findAll( {query: { pager, searcher } })
const result = await this.TspdeviceService.findAll({ pager, searcher });
this.ctx.body = this.ServerResponse.Success(result);
}
}
module.exports = TspdeviceController;
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module.exports = app => { module.exports = app => {
const DataTypes = app.Sequelize; const DataTypes = app.Sequelize;
const Model = app.model.define('dj_follow_record', { const Model = app.model.define('dj_car_collision', {
id: { id: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: false, allowNull: false,
...@@ -11,49 +11,49 @@ module.exports = app => { ...@@ -11,49 +11,49 @@ module.exports = app => {
autoIncrement: true autoIncrement: true
}, },
sn: { sn: {
type: DataTypes.STRING(20), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
stand_no: { stand_no: {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: true allowNull: true
}, },
follow_time: { collision_time: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
follow_result: { collision_type: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
remarks: { address: {
type: DataTypes.STRING(64), type: DataTypes.STRING(120),
allowNull: true allowNull: true
}, },
source: { longitude: {
type: DataTypes.INTEGER(11), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
LOG: { latitude: {
type: DataTypes.TEXT, type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
make_time: { distance: {
type: DataTypes.DATE, type: "DOUBLE(10,3)",
allowNull: true
},
current_mileage: {
type: "DOUBLE(11,4)",
allowNull: true, allowNull: true,
defaultValue: '0.0000' defaultValue: '0.000'
}, },
vehicle_id: { speed: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
merchant_id: { merchant_id: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: false
}, },
created_by: { created_by: {
type: DataTypes.STRING(64), type: DataTypes.STRING(64),
...@@ -73,15 +73,11 @@ module.exports = app => { ...@@ -73,15 +73,11 @@ module.exports = app => {
}, },
deleted_flag: { deleted_flag: {
type: DataTypes.CHAR(1), type: DataTypes.CHAR(1),
allowNull: true, allowNull: false,
defaultValue: 'N' defaultValue: 'N'
},
datafrom: {
type: DataTypes.INTEGER(1),
allowNull: true
} }
}, { }, {
tableName: 'dj_follow_record' tableName: 'dj_car_collision'
}); });
Model.associate = function() { Model.associate = function() {
......
...@@ -18,18 +18,6 @@ module.exports = app => { ...@@ -18,18 +18,6 @@ module.exports = app => {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: true allowNull: true
}, },
plate_number: {
type: DataTypes.STRING(16),
allowNull: true
},
name: {
type: DataTypes.STRING(64),
allowNull: true
},
mobile: {
type: DataTypes.STRING(11),
allowNull: true
},
enter_time: { enter_time: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
...@@ -56,29 +44,26 @@ module.exports = app => { ...@@ -56,29 +44,26 @@ module.exports = app => {
allowNull: true, allowNull: true,
defaultValue: '0' defaultValue: '0'
}, },
erp_mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
current_mileage: { current_mileage: {
type: DataTypes.FLOAT, type: DataTypes.FLOAT,
allowNull: true allowNull: true
}, },
vehicle_id: { merchant_type: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
merchant_type: { merchant_id: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: false
}, },
pmerchant_name: { merchant_name: {
type: DataTypes.STRING(32), type: DataTypes.STRING(64),
allowNull: true allowNull: true
}, },
merchant_id: { last_year_loss: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: false allowNull: true,
defaultValue: '0'
}, },
created_by: { created_by: {
type: DataTypes.STRING(64), type: DataTypes.STRING(64),
...@@ -100,59 +85,6 @@ module.exports = app => { ...@@ -100,59 +85,6 @@ module.exports = app => {
type: DataTypes.CHAR(1), type: DataTypes.CHAR(1),
allowNull: false, allowNull: false,
defaultValue: 'N' defaultValue: 'N'
},
last_year_loss: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
factory_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
factory_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
province_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
city_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_name: {
type: DataTypes.STRING(64),
allowNull: true
},
area_name: {
type: DataTypes.STRING(64),
allowNull: true
},
competition_rel_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
datafrom: {
type: DataTypes.INTEGER(1),
allowNull: true
} }
}, { }, {
tableName: 'dj_car_loss_warning' tableName: 'dj_car_loss_warning'
......
...@@ -18,22 +18,6 @@ module.exports = app => { ...@@ -18,22 +18,6 @@ module.exports = app => {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: true allowNull: true
}, },
plate_number: {
type: DataTypes.STRING(64),
allowNull: true
},
name: {
type: DataTypes.STRING(64),
allowNull: true
},
mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
current_day_time: {
type: DataTypes.DATE,
allowNull: true
},
total_mileage: { total_mileage: {
type: "DOUBLE(11,2)", type: "DOUBLE(11,2)",
allowNull: true allowNull: true
...@@ -46,39 +30,10 @@ module.exports = app => { ...@@ -46,39 +30,10 @@ module.exports = app => {
type: "DOUBLE(11,2)", type: "DOUBLE(11,2)",
allowNull: true allowNull: true
}, },
company: {
type: DataTypes.STRING(64),
allowNull: true
},
car_brand: {
type: DataTypes.STRING(32),
allowNull: true
},
car_model: {
type: DataTypes.STRING(64),
allowNull: true
},
car_system: {
type: DataTypes.STRING(32),
allowNull: true
},
regist_time: {
type: DataTypes.DATE,
allowNull: true
},
first_time: { first_time: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
insurance_time: {
type: DataTypes.DATE,
allowNull: true
},
status: {
type: DataTypes.INTEGER(2),
allowNull: true,
defaultValue: '1'
},
remind_type: { remind_type: {
type: DataTypes.INTEGER(2), type: DataTypes.INTEGER(2),
allowNull: true allowNull: true
...@@ -107,26 +62,6 @@ module.exports = app => { ...@@ -107,26 +62,6 @@ module.exports = app => {
allowNull: true, allowNull: true,
defaultValue: '0' defaultValue: '0'
}, },
erp_mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
vehicle_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
follow_result: {
type: DataTypes.INTEGER(2),
allowNull: true
},
follow_time: {
type: DataTypes.DATE,
allowNull: true
},
follow_remarks: {
type: DataTypes.STRING(480),
allowNull: true
},
numbers: { numbers: {
type: DataTypes.INTEGER(3), type: DataTypes.INTEGER(3),
allowNull: true, allowNull: true,
...@@ -145,6 +80,10 @@ module.exports = app => { ...@@ -145,6 +80,10 @@ module.exports = app => {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: false allowNull: false
}, },
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
created_by: { created_by: {
type: DataTypes.STRING(64), type: DataTypes.STRING(64),
allowNull: true allowNull: true
...@@ -165,50 +104,6 @@ module.exports = app => { ...@@ -165,50 +104,6 @@ module.exports = app => {
type: DataTypes.CHAR(1), type: DataTypes.CHAR(1),
allowNull: false, allowNull: false,
defaultValue: 'N' defaultValue: 'N'
},
factory_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
factory_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
province_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
city_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_name: {
type: DataTypes.STRING(64),
allowNull: true
},
area_name: {
type: DataTypes.STRING(64),
allowNull: true
},
datafrom: {
type: DataTypes.INTEGER(1),
allowNull: true
} }
}, { }, {
tableName: 'dj_car_maintain' tableName: 'dj_car_maintain'
......
...@@ -18,24 +18,12 @@ module.exports = app => { ...@@ -18,24 +18,12 @@ module.exports = app => {
type: DataTypes.STRING(50), type: DataTypes.STRING(50),
allowNull: true allowNull: true
}, },
plate_number: { merchant_id: {
type: DataTypes.STRING(64),
allowNull: true
},
name: {
type: DataTypes.STRING(64),
allowNull: true
},
mobile: {
type: DataTypes.STRING(11),
allowNull: true
},
merchant_type: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: false
}, },
pmerchant_name: { merchant_name: {
type: DataTypes.STRING(32), type: DataTypes.STRING(64),
allowNull: true allowNull: true
}, },
enter_time: { enter_time: {
...@@ -83,21 +71,14 @@ module.exports = app => { ...@@ -83,21 +71,14 @@ module.exports = app => {
allowNull: true, allowNull: true,
defaultValue: '0' defaultValue: '0'
}, },
erp_mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
current_mileage: { current_mileage: {
type: "DOUBLE(11,4)", type: "DOUBLE(11,4)",
allowNull: true allowNull: true
}, },
vehicle_id: { last_year_shops: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_id: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: false allowNull: true,
defaultValue: '0'
}, },
created_by: { created_by: {
type: DataTypes.STRING(64), type: DataTypes.STRING(64),
...@@ -119,55 +100,6 @@ module.exports = app => { ...@@ -119,55 +100,6 @@ module.exports = app => {
type: DataTypes.CHAR(1), type: DataTypes.CHAR(1),
allowNull: false, allowNull: false,
defaultValue: 'N' defaultValue: 'N'
},
last_year_shops: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
factory_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
factory_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
province_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
city_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
province_name: {
type: DataTypes.STRING(64),
allowNull: true
},
city_name: {
type: DataTypes.STRING(64),
allowNull: true
},
area_name: {
type: DataTypes.STRING(64),
allowNull: true
},
datafrom: {
type: DataTypes.INTEGER(1),
allowNull: true
} }
}, { }, {
tableName: 'dj_car_shop_warning' tableName: 'dj_car_shop_warning'
......
/* indent size: 2 */
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('dj_device_info', {
id: {
type: DataTypes.BIGINT,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
device_sn: {
type: DataTypes.STRING(32),
allowNull: true
},
sim_no: {
type: DataTypes.STRING(24),
allowNull: true
},
active_time: {
type: DataTypes.DATE,
allowNull: true
},
seq_no: {
type: DataTypes.STRING(64),
allowNull: true
},
period: {
type: DataTypes.INTEGER(1),
allowNull: true
},
device_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
effect_date: {
type: DataTypes.DATE,
allowNull: true
},
end_date: {
type: DataTypes.DATE,
allowNull: true
},
device_status: {
type: DataTypes.CHAR(2),
allowNull: true
},
merchant: {
type: DataTypes.STRING(128),
allowNull: true
},
created_by: {
type: DataTypes.STRING(128),
allowNull: true
},
created_date: {
type: DataTypes.DATE,
allowNull: true
},
updated_by: {
type: DataTypes.STRING(128),
allowNull: true
},
updated_date: {
type: DataTypes.DATE,
allowNull: true
},
deleted_flag: {
type: DataTypes.CHAR(1),
allowNull: true,
defaultValue: 'N'
}
}, {
tableName: 'dj_device_info'
});
Model.associate = function() {
}
return Model;
};
...@@ -3,50 +3,28 @@ ...@@ -3,50 +3,28 @@
module.exports = app => { module.exports = app => {
const DataTypes = app.Sequelize; const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_biz_delivery', { const Model = app.model.define('dj_system_login_log', {
id: { id: {
type: DataTypes.INTEGER(11), type: DataTypes.BIGINT,
allowNull: false, allowNull: false,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true
}, },
month: {
type: DataTypes.STRING(32),
allowNull: false
},
shop_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: false
},
shop_merchant_name: {
type: DataTypes.STRING(100),
allowNull: false
},
merchant_id: { merchant_id: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
merchant_name: { merchant_name: {
type: DataTypes.STRING(100), type: DataTypes.STRING(256),
allowNull: false
},
biz_type: {
type: DataTypes.INTEGER(4),
allowNull: true
},
device_type: {
type: DataTypes.INTEGER(6),
allowNull: true allowNull: true
}, },
delivery_total: { login_name: {
type: DataTypes.INTEGER(11), type: DataTypes.STRING(50),
allowNull: true, allowNull: false
defaultValue: '0'
}, },
active_total: { login_time: {
type: DataTypes.INTEGER(11), type: DataTypes.DATE,
allowNull: true, allowNull: false
defaultValue: '0'
}, },
create_time: { create_time: {
type: DataTypes.DATE, type: DataTypes.DATE,
...@@ -57,7 +35,7 @@ module.exports = app => { ...@@ -57,7 +35,7 @@ module.exports = app => {
allowNull: true allowNull: true
} }
}, { }, {
tableName: 'glsx_biz_delivery' tableName: 'dj_system_login_log'
}); });
Model.associate = function() { Model.associate = function() {
......
...@@ -3,51 +3,61 @@ ...@@ -3,51 +3,61 @@
module.exports = app => { module.exports = app => {
const DataTypes = app.Sequelize; const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_basic_clues', { const Model = app.model.define('fmrs_device_info', {
id: { id: {
type: DataTypes.INTEGER(11), type: DataTypes.BIGINT,
allowNull: false, allowNull: false,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true
}, },
sn: { sn: {
type: DataTypes.STRING(32), type: DataTypes.STRING(32),
allowNull: true,
unique: true
},
imsi: {
type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
stand_no: { sim_no: {
type: DataTypes.STRING(64), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
name: { iccid: {
type: DataTypes.STRING(64), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
mobile: { device_type: {
type: DataTypes.STRING(16), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
biz_type: { device_name: {
type: DataTypes.INTEGER(1), type: DataTypes.STRING(24),
allowNull: true allowNull: true
}, },
clue_time: { status: {
type: DataTypes.INTEGER(1),
allowNull: true,
defaultValue: '1'
},
active_time: {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
arrshop_time: { period: {
type: DataTypes.DATE, type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
price: { pk_begin_time: {
type: DataTypes.FLOAT, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
merchant_id: { pk_end_time: {
type: DataTypes.INTEGER(11), type: DataTypes.DATE,
allowNull: false allowNull: true
}, },
merchant_name: { active_month: {
type: DataTypes.STRING(64), type: DataTypes.STRING(16),
allowNull: true allowNull: true
}, },
create_time: { create_time: {
...@@ -59,7 +69,7 @@ module.exports = app => { ...@@ -59,7 +69,7 @@ module.exports = app => {
allowNull: true allowNull: true
} }
}, { }, {
tableName: 'glsx_basic_clues' tableName: 'fmrs_device_info'
}); });
Model.associate = function() { Model.associate = function() {
......
/* indent size: 2 */
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_biz_opportunity', {
id: {
type: DataTypes.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: true
},
month: {
type: DataTypes.STRING(32),
allowNull: false
},
merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: false
},
total_gmv: {
type: "DOUBLE(12,2)",
allowNull: true,
defaultValue: '0.00'
},
maintain_crues: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
maintain_arr: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
maintain_gmv: {
type: "DOUBLE(12,2)",
allowNull: true,
defaultValue: '0.00'
},
loss_crues: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
loss_arr: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
loss_gmv: {
type: "DOUBLE(12,2)",
allowNull: true,
defaultValue: '0.00'
},
collision_crues: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
collision_arr: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
collision_gmv: {
type: "DOUBLE(12,2)",
allowNull: true,
defaultValue: '0.00'
}
}, {
tableName: 'glsx_biz_opportunity'
});
Model.associate = function() {
}
return Model;
};
/* indent size: 2 */
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_sync_log', {
ID: {
type: DataTypes.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: true
},
tblName: {
type: DataTypes.STRING(32),
allowNull: true,
defaultValue: '',
unique: true
},
synId: {
type: DataTypes.BIGINT,
allowNull: true,
defaultValue: '0'
},
createtime: {
type: DataTypes.DATE,
allowNull: true
},
updatetime: {
type: DataTypes.DATE,
allowNull: true
}
}, {
tableName: 'glsx_sync_log'
});
Model.associate = function() {
}
return Model;
};
...@@ -3,103 +3,49 @@ ...@@ -3,103 +3,49 @@
module.exports = app => { module.exports = app => {
const DataTypes = app.Sequelize; const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_basic_devices', { const Model = app.model.define('tsp_device_info', {
id: { id: {
type: DataTypes.INTEGER(11), type: DataTypes.BIGINT,
allowNull: false, allowNull: false,
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true
}, },
sn: { sn: {
type: DataTypes.STRING(32), type: DataTypes.STRING(32),
allowNull: true allowNull: true,
unique: true
}, },
sim_phone: { imsi: {
type: DataTypes.STRING(32), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
biz_type: { simno: {
type: DataTypes.INTEGER(4), type: DataTypes.STRING(32),
allowNull: true
},
device_type: {
type: DataTypes.INTEGER(6),
allowNull: true
},
in_storage_time: {
type: DataTypes.DATE,
allowNull: true
},
out_storage_time: {
type: DataTypes.DATE,
allowNull: true
},
shop_merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
active_time: {
type: DataTypes.DATE,
allowNull: true
},
active_lng: {
type: "DOUBLE(10,6)",
allowNull: true
},
active_lat: {
type: "DOUBLE(10,6)",
allowNull: true
},
active_provcode: {
type: DataTypes.INTEGER(6),
allowNull: true
},
active_province: {
type: DataTypes.STRING(64),
allowNull: true
},
active_citycode: {
type: DataTypes.INTEGER(6),
allowNull: true
},
active_city: {
type: DataTypes.STRING(64),
allowNull: true
},
latest_gpstime: {
type: DataTypes.DATE,
allowNull: true
},
latest_cityname: {
type: DataTypes.STRING(64),
allowNull: true
},
latest_citycode: {
type: DataTypes.INTEGER(6),
allowNull: true allowNull: true
}, },
latest_provname: { iccid: {
type: DataTypes.STRING(32), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
latest_provcode: { device_type: {
type: DataTypes.INTEGER(6), type: DataTypes.INTEGER(11),
allowNull: true allowNull: true
}, },
user_phone: { device_name: {
type: DataTypes.STRING(32), type: DataTypes.STRING(24),
allowNull: true allowNull: true
}, },
user_standno: { package_name: {
type: DataTypes.STRING(32), type: DataTypes.STRING(32),
allowNull: true allowNull: true
}, },
drive_days: { status: {
type: DataTypes.INTEGER(11), type: DataTypes.INTEGER(1),
allowNull: true allowNull: true,
defaultValue: '1'
}, },
avr_day_miles: { active_time: {
type: "DOUBLE(12,2)", type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
pk_begin_time: { pk_begin_time: {
...@@ -110,8 +56,8 @@ module.exports = app => { ...@@ -110,8 +56,8 @@ module.exports = app => {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
datafrom: { active_month: {
type: DataTypes.STRING(32), type: DataTypes.STRING(16),
allowNull: true allowNull: true
}, },
create_time: { create_time: {
...@@ -123,11 +69,11 @@ module.exports = app => { ...@@ -123,11 +69,11 @@ module.exports = app => {
allowNull: true allowNull: true
} }
}, { }, {
tableName: 'glsx_basic_devices' tableName: 'tsp_device_info'
}); });
Model.associate = function() { Model.associate = function() {
} }
return Model; return Model;
......
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-11-21 11:19:15 * @Date: 2019-11-21 11:19:15
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-06-19 11:45:09 * @Last Modified time: 2020-11-23 17:04:58
*/ */
module.exports = (app) => { module.exports = (app) => {
app.router.get("/biz/loss/findAll", app.controller.biz.loss.findAll); app.router.get('/biz/loss/findAll', app.controller.biz.loss.findAll)
app.router.get("/biz/maintain/findAll", app.controller.biz.maintain.findAll); app.router.get('/biz/maintain/findAll', app.controller.biz.maintain.findAll)
app.router.get("/biz/shop/findAll", app.controller.biz.shop.findAll); app.router.get('/biz/shop/findAll', app.controller.biz.shop.findAll)
app.router.get("/biz/record/findAll", app.controller.biz.record.findAll); app.router.get('/biz/collision/findAll', app.controller.biz.collision.findAll)
app.router.get("/biz/merchant/findAll", app.controller.biz.merchant.findAll); app.router.get('/biz/record/findAll', app.controller.biz.record.findAll)
app.router.get("/biz/devices/findAll", app.controller.biz.devices.findAll); app.router.get('/biz/merchant/findAll', app.controller.biz.merchant.findAll)
app.router.get("/biz/delivery/findAll", app.controller.biz.delivery.findAll); app.router.get('/biz/devices/findAll', app.controller.biz.devices.findAll)
app.router.get("/biz/delivery/findCount", app.controller.biz.delivery.findCount); app.router.get('/biz/delivery/findAll', app.controller.biz.delivery.findAll)
app.router.get("/biz/clues/findAll", app.controller.biz.clues.findAll); app.router.get('/biz/delivery/findCount', app.controller.biz.delivery.findCount)
app.router.get("/biz/opportunity/findAll", app.controller.biz.opportunity.findAll); app.router.get('/biz/clues/findAll', app.controller.biz.clues.findAll)
app.router.get("/biz/opportunity/findCount", app.controller.biz.opportunity.findCount); app.router.get('/biz/opportunity/findAll', app.controller.biz.opportunity.findAll)
}; app.router.get('/biz/opportunity/findCount', app.controller.biz.opportunity.findCount)
app.router.get('/biz/merchantlog/findAll', app.controller.biz.merchantlog.findAll)
app.router.get('/biz/tspdevice/findAll', app.controller.biz.tspdevice.findAll)
app.router.get('/biz/fmrsdevice/findAll', app.controller.biz.fmrsdevice.findAll)
}
/*
* @Author: huyue
* @Date: 2020-11-23 15:51:04
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:27:07
*/
const Service = require("egg").Service;
class CollisionService extends Service {
constructor(ctx) {
super(ctx);
this.helper = ctx.helper;
this._reg_models_alias_();
// this._associate_();
}
/**
* 绑定model 在 this 上的 别名
*/
_reg_models_alias_() {
const { DjCarCollision } = this.app.model.Biz;
this.MDCC = DjCarCollision;
}
/**
* 绑定表关系
*/
_associate_() {}
/**
* @param field {String}
* @param value {String}
* @return {Promise.<boolean>}
* @Description 查询所有
*/
async findAll({ pager = {}, searcher = {} }) {
const { current = 1, size = 10 } = pager;
const {} = searcher;
const offset = (current - 1) * size;
const { Op, col, literal } = this.app.Sequelize;
let where = { };
return await this.MDCC.findAndCountAll({
offset,
limit: +size,
where,
raw: true,
});
}
}
module.exports = CollisionService;
/* /*
* @Author: chenwq * @Author: chenwq
* @Date: 2020-06-16 10:02:39 * @Date: 2020-06-16 10:02:39
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-06-19 16:14:30 * @Last Modified time: 2020-11-23 16:31:36
* 设备信息 * 设备信息
*/ */
...@@ -19,10 +19,10 @@ class DevicesService extends Service { ...@@ -19,10 +19,10 @@ class DevicesService extends Service {
*/ */
_reg_models_alias_() { _reg_models_alias_() {
const { const {
GlsxBasicDevices, DjDeviceInfo,
DjSystemMerchant DjSystemMerchant
} = this.app.model.Biz; } = this.app.model.Biz;
this.GBDE = GlsxBasicDevices; this.MDDI = DjDeviceInfo;
this.MDSM = DjSystemMerchant; this.MDSM = DjSystemMerchant;
} }
...@@ -95,25 +95,25 @@ class DevicesService extends Service { ...@@ -95,25 +95,25 @@ class DevicesService extends Service {
where[item.sqlName] = searcher[item.name] where[item.sqlName] = searcher[item.name]
} }
}) })
let date = await this.GBDE.findAndCountAll({ let date = await this.MDDI.findAndCountAll({
attributes: { // attributes: {
include: [ // include: [
[col('dj_system_merchant.merchant_name'), 'shop_merchant_name'] // [col('dj_system_merchant.merchant_name'), 'shop_merchant_name']
] // ]
}, // },
offset, offset,
limit: +size, limit: +size,
where, where,
raw: true, raw: true,
include: [{ // include: [{
model: this.MDSM, // model: this.MDSM,
as: 'dj_system_merchant', // as: 'dj_system_merchant',
attributes: [], // attributes: [],
associate: this.GBDE.belongsTo(this.MDSM, { // associate: this.MDDI.belongsTo(this.MDSM, {
foreignKey: 'shop_merchant_id', // foreignKey: 'shop_merchant_id',
targetKey: 'merchant_id' // targetKey: 'merchant_id'
}) // })
}] // }]
}) })
date.rows && date.rows.forEach(item => { date.rows && date.rows.forEach(item => {
item.address = '' item.address = ''
......
/*
* @Author: huyue
* @Date: 2020-11-23 16:45:21
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:46:45
*/
const Service = require("egg").Service;
class FmrsdeviceService extends Service {
constructor(ctx) {
super(ctx);
this.helper = ctx.helper;
this._reg_models_alias_();
// this._associate_();
}
/**
* 绑定model 在 this 上的 别名
*/
_reg_models_alias_() {
const { FmrsDeviceInfo } = this.app.model.Biz;
this.MFDI = FmrsDeviceInfo;
}
/**
* 绑定表关系
*/
_associate_() {}
/**
* @param field {String}
* @param value {String}
* @return {Promise.<boolean>}
* @Description 查询所有
*/
async findAll({ pager = {}, searcher = {} }) {
const { current = 1, size = 10 } = pager;
const {} = searcher;
const offset = (current - 1) * size;
const { Op, col, literal } = this.app.Sequelize;
let where = { };
return await this.MFDI.findAndCountAll({
offset,
limit: +size,
where,
raw: true,
});
}
}
module.exports = FmrsdeviceService;
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-11-21 11:18:37 * @Date: 2019-11-21 11:18:37
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-09-08 15:02:37 * @Last Modified time: 2020-11-23 15:51:44
*/ */
const Service = require("egg").Service; const Service = require("egg").Service;
......
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-11-21 11:18:37 * @Date: 2019-11-21 11:18:37
* @Last Modified by: limin * @Last Modified by: huyue
* @Last Modified time: 2020-04-20 13:54:35 * @Last Modified time: 2020-11-23 18:02:28
*/ */
const Service = require("egg").Service; const Service = require("egg").Service;
...@@ -55,7 +55,7 @@ class MaintainService extends Service { ...@@ -55,7 +55,7 @@ class MaintainService extends Service {
const { const {
Op Op
} = this.app.Sequelize; } = this.app.Sequelize;
let where = { is_new: isNew }; let where = { };
if (searchValue) { if (searchValue) {
const __like = `%${searchValue}%`; const __like = `%${searchValue}%`;
where = { where = {
......
/* /*
* @Author: chenwq * @Author: chenwq
* @Date: 2020-06-12 15:19:31 * @Date: 2020-06-12 15:19:31
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-06-18 11:29:42 * @Last Modified time: 2020-11-23 16:28:01
*/ */
const Service = require("egg").Service; const Service = require("egg").Service;
......
/*
* @Author: huyue
* @Date: 2020-11-23 16:29:59
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:34:48
*/
const Service = require("egg").Service;
class MerchantlogService extends Service {
constructor(ctx) {
super(ctx);
this.helper = ctx.helper;
this._reg_models_alias_();
// this._associate_();
}
/**
* 绑定model 在 this 上的 别名
*/
_reg_models_alias_() {
const { DjSystemLoginLog } = this.app.model.Biz;
this.MDSLL = DjSystemLoginLog;
}
/**
* 绑定表关系
*/
_associate_() {}
/**
* @param field {String}
* @param value {String}
* @return {Promise.<boolean>}
* @Description 查询所有
*/
async findAll({ pager = {}, searcher = {} }) {
const { current = 1, size = 10 } = pager;
const {} = searcher;
const offset = (current - 1) * size;
const { Op, col, literal } = this.app.Sequelize;
let where = { };
return await this.MDSLL.findAndCountAll({
offset,
limit: +size,
where,
raw: true,
});
}
}
module.exports = MerchantlogService;
/*
* @Author: huyue
* @Date: 2020-11-23 16:43:15
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 17:03:49
*/
const Service = require("egg").Service;
class TspdeviceService extends Service {
constructor(ctx) {
super(ctx);
this.helper = ctx.helper;
this._reg_models_alias_();
// this._associate_();
}
/**
* 绑定model 在 this 上的 别名
*/
_reg_models_alias_() {
const { TspDeviceInfo } = this.app.model.Biz;
this.MTDI = TspDeviceInfo;
}
/**
* 绑定表关系
*/
_associate_() {}
/**
* @param field {String}
* @param value {String}
* @return {Promise.<boolean>}
* @Description 查询所有
*/
async findAll({ pager = {}, searcher = {} }) {
const { current = 1, size = 10 } = pager;
const {} = searcher;
const offset = (current - 1) * size;
const { Op, col, literal } = this.app.Sequelize;
let where = { };
return await this.MTDI.findAndCountAll({
offset,
limit: +size,
where,
raw: true,
});
}
}
module.exports = TspdeviceService;
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-11-16 09:26:53 * @Date: 2019-11-16 09:26:53
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-09-01 15:36:55 * @Last Modified time: 2020-11-23 18:05:32
*/ */
/* eslint valid-jsdoc: "off" */ /* eslint valid-jsdoc: "off" */
"use strict"; 'use strict'
/** /**
* @param {Egg.EggAppInfo} app app info * @param {Egg.EggAppInfo} app app info
...@@ -17,89 +17,89 @@ module.exports = app => { ...@@ -17,89 +17,89 @@ module.exports = app => {
* built-in config * built-in config
* @type {Egg.EggAppConfig} * @type {Egg.EggAppConfig}
**/ **/
const config = (exports = {}); const config = (exports = {})
// use for cookie sign key, should change to your own and keep security // use for cookie sign key, should change to your own and keep security
config.keys = app.name + "_1573615133248_6253"; config.keys = app.name + '_1573615133248_6253'
// add your middleware config here // add your middleware config here
// config.middleware = [ 'errorHandler']; // config.middleware = [ 'errorHandler']
config.onerror = { config.onerror = {
//全局异常捕获 // 全局异常捕获
all(err, ctx) { all(err, ctx) {
// 在此处定义针对所有响应类型的错误处理方法 // 在此处定义针对所有响应类型的错误处理方法
// 注意,定义了 config.all 之后,其他错误处理方法不会再生效 // 注意,定义了 config.all 之后,其他错误处理方法不会再生效
// 所有的异常都在 app 上触发一个 error 事件,框架会记录一条错误日志 // 所有的异常都在 app 上触发一个 error 事件,框架会记录一条错误日志
ctx.app.emit("error", err, ctx); ctx.app.emit('error', err, ctx)
const status = err.status || 500; const status = err.status || 500
// 生产环境时 500 错误的详细错误内容不返回给客户端,因为可能包含敏感信息 // 生产环境时 500 错误的详细错误内容不返回给客户端,因为可能包含敏感信息
const error = const error =
status === 500 && ctx.app.config.env === "prod" status === 500 && ctx.app.config.env === 'prod'
? "Internal Server Error" ? 'Internal Server Error'
: err.message; : err.message
// 从 error 对象上读出各个属性,设置到响应中 // 从 error 对象上读出各个属性,设置到响应中
ctx.body = JSON.stringify( ctx.body = JSON.stringify(
ctx.response.ServerResponse.Error({ message: error }) ctx.response.ServerResponse.Error({ message: error })
); )
if (status === 422) { if (status === 422) {
ctx.body.detail = err.errors; ctx.body.detail = err.errors
} }
ctx.status = status; ctx.status = status
} }
// html(err, ctx) { // html(err, ctx) {
// // html hander // // html hander
// ctx.body = '<h3>error</h3>'; // ctx.body = '<h3>error</h3>'
// ctx.status = 500; // ctx.status = 500
// }, // },
// json(err, ctx) { // json(err, ctx) {
// // json hander // // json hander
// ctx.body = { message: 'error' }; // ctx.body = { message: 'error' }
// ctx.status = 500; // ctx.status = 500
// }, // },
// jsonp(err, ctx) { // jsonp(err, ctx) {
// // 一般来说,不需要特殊针对 jsonp 进行错误定义,jsonp 的错误处理会自动调用 json 错误处理,并包装成 jsonp 的响应格式 // // 一般来说,不需要特殊针对 jsonp 进行错误定义,jsonp 的错误处理会自动调用 json 错误处理,并包装成 jsonp 的响应格式
// }, // },
}; }
// add your user config here // add your user config here
// const userConfig = { // const userConfig = {
config.jwt = { config.jwt = {
secret: "glsx-insurence-egg-server" //自定义 token 的加密条件字符串 secret: 'glsx-insurence-egg-server' // 自定义 token 的加密条件字符串
}; }
config.cors = { config.cors = {
// origin: "http://192.168.2.222:8085", origin: 'http://192.168.2.2:8085',
credentials: true, credentials: true,
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH' allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
}; }
config.security = { config.security = {
csrf: { csrf: {
enable: false, enable: false,
ignoreJSON: true ignoreJSON: true
}, },
// domainWhiteList: ["http://192.168.2.222:8085"] //允许访问接口的白名单 // domainWhiteList: ["http://192.168.2.222:8085"] //允许访问接口的白名单
domainWhiteList: ["http://localhost:8085", "http://192.168.2.201:8085", "http://192.168.2.27:8085"] //允许访问接口的白名单 domainWhiteList: ['http://localhost:8085', 'http://192.168.2.2:8085', 'http://192.168.2.27:8085'] // 允许访问接口的白名单
}; }
config.redis = { config.redis = {
client: { client: {
port: 6379, // Redis port port: 6379, // Redis port
host: "127.0.0.1", // Redis host host: '127.0.0.1', // Redis host
password: "", password: '',
db: 0 db: 0
} }
}; }
// 改变请求ip // 改变请求ip
// config.cluster = { // config.cluster = {
// listen: { // listen: {
// port: 8000, // port: 8000,
// hostname: '192.168.2.201' // hostname: '192.168.2.201'
// } // }
// }; // }
config.validate = { config.validate = {
// convert: false, // convert: false,
// validateRoot: false, // validateRoot: false,
}; }
config.sequelize = { config.sequelize = {
timezone: '+08:00', timezone: '+08:00',
define: { define: {
...@@ -108,26 +108,26 @@ module.exports = app => { ...@@ -108,26 +108,26 @@ module.exports = app => {
timestamps: false // 不自动维护时间戳 [ created_at、updated_at ] timestamps: false // 不自动维护时间戳 [ created_at、updated_at ]
}, },
dialectOptions: { dialectOptions: {
dateStrings: true, //格式化datetime dateStrings: true, // 格式化datetime
typeCast: true typeCast: true
} }
}; }
config.swaggerdoc = { config.swaggerdoc = {
dirScanner: "./app/controller", dirScanner: './app/controller',
apiInfo: { apiInfo: {
title: "广联运营", title: '广联运营',
description: "swagger-ui for egg", description: 'swagger-ui for egg',
version: "1.0.0" version: '1.0.0'
}, },
schemes: ["http", "https"], schemes: ['http', 'https'],
consumes: ["application/json"], consumes: ['application/json'],
produces: ["application/json"], produces: ['application/json'],
securityDefinitions: {}, securityDefinitions: {},
enableSecurity: false, enableSecurity: false,
// enableValidate: true, // enableValidate: true,
routerMap: true, routerMap: true,
enable: true enable: true
}; }
return config; return config
}; }
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-11-16 09:26:47 * @Date: 2019-11-16 09:26:47
* @Last Modified by: limin * @Last Modified by: huyue
* @Last Modified time: 2020-04-15 10:59:34 * @Last Modified time: 2020-11-23 10:19:32
*/ */
/* eslint valid-jsdoc: "off" */ /* eslint valid-jsdoc: "off" */
"use strict"; 'use strict'
const path = require("path"); const path = require('path')
/** /**
* @param {Egg.EggAppInfo} appInfo app info * @param {Egg.EggAppInfo} appInfo app info
*/ */
...@@ -17,21 +17,21 @@ module.exports = appInfo => { ...@@ -17,21 +17,21 @@ module.exports = appInfo => {
* built-in config * built-in config
* @type {Egg.EggAppConfig} * @type {Egg.EggAppConfig}
**/ **/
const config = (exports = {}); const config = (exports = {})
config.logger = { config.logger = {
level: "INFO", level: 'INFO',
dir: path.join(__dirname, "../logs/dev") // 保存路径为工程路径下`logs/dev` dir: path.join(__dirname, '../logs/dev') // 保存路径为工程路径下`logs/dev`
}; }
// add your user config here // add your user config here
// myAppName: 'egg', // myAppName: 'egg',
config.sequelize = { config.sequelize = {
dialect: "mysql",
host: "192.168.3.153",
port: "3308",
database: "glsx_audit",
username: "apuser",
password: "123456"
};
return config;
};
\ No newline at end of file \ No newline at end of file
dialect: 'mysql',
host: '192.168.3.227',
port: '3306',
database: 'glsx_biz_data',
username: 'dev_admin',
password: '1f7e1ed2'
}
return config
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!