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 @@
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('dj_follow_record', {
const Model = app.model.define('dj_car_collision', {
id: {
type: DataTypes.INTEGER(11),
allowNull: false,
......@@ -11,49 +11,49 @@ module.exports = app => {
autoIncrement: true
},
sn: {
type: DataTypes.STRING(20),
type: DataTypes.STRING(32),
allowNull: true
},
stand_no: {
type: DataTypes.STRING(50),
allowNull: true
},
follow_time: {
collision_time: {
type: DataTypes.DATE,
allowNull: true
},
follow_result: {
collision_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
remarks: {
type: DataTypes.STRING(64),
address: {
type: DataTypes.STRING(120),
allowNull: true
},
source: {
type: DataTypes.INTEGER(11),
longitude: {
type: DataTypes.STRING(32),
allowNull: true
},
LOG: {
type: DataTypes.TEXT,
latitude: {
type: DataTypes.STRING(32),
allowNull: true
},
make_time: {
type: DataTypes.DATE,
allowNull: true
},
current_mileage: {
type: "DOUBLE(11,4)",
distance: {
type: "DOUBLE(10,3)",
allowNull: true,
defaultValue: '0.0000'
defaultValue: '0.000'
},
vehicle_id: {
speed: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
allowNull: false
},
created_by: {
type: DataTypes.STRING(64),
......@@ -73,15 +73,11 @@ module.exports = app => {
},
deleted_flag: {
type: DataTypes.CHAR(1),
allowNull: true,
allowNull: false,
defaultValue: 'N'
},
datafrom: {
type: DataTypes.INTEGER(1),
allowNull: true
}
}, {
tableName: 'dj_follow_record'
tableName: 'dj_car_collision'
});
Model.associate = function() {
......
......@@ -18,18 +18,6 @@ module.exports = app => {
type: DataTypes.STRING(50),
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: {
type: DataTypes.DATE,
allowNull: true
......@@ -56,29 +44,26 @@ module.exports = app => {
allowNull: true,
defaultValue: '0'
},
erp_mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
current_mileage: {
type: DataTypes.FLOAT,
allowNull: true
},
vehicle_id: {
merchant_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_type: {
merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
allowNull: false
},
pmerchant_name: {
type: DataTypes.STRING(32),
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
merchant_id: {
last_year_loss: {
type: DataTypes.INTEGER(11),
allowNull: false
allowNull: true,
defaultValue: '0'
},
created_by: {
type: DataTypes.STRING(64),
......@@ -100,59 +85,6 @@ module.exports = app => {
type: DataTypes.CHAR(1),
allowNull: false,
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'
......
......@@ -18,22 +18,6 @@ module.exports = app => {
type: DataTypes.STRING(50),
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: {
type: "DOUBLE(11,2)",
allowNull: true
......@@ -46,39 +30,10 @@ module.exports = app => {
type: "DOUBLE(11,2)",
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: {
type: DataTypes.DATE,
allowNull: true
},
insurance_time: {
type: DataTypes.DATE,
allowNull: true
},
status: {
type: DataTypes.INTEGER(2),
allowNull: true,
defaultValue: '1'
},
remind_type: {
type: DataTypes.INTEGER(2),
allowNull: true
......@@ -107,26 +62,6 @@ module.exports = app => {
allowNull: true,
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: {
type: DataTypes.INTEGER(3),
allowNull: true,
......@@ -145,6 +80,10 @@ module.exports = app => {
type: DataTypes.INTEGER(11),
allowNull: false
},
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
created_by: {
type: DataTypes.STRING(64),
allowNull: true
......@@ -165,50 +104,6 @@ module.exports = app => {
type: DataTypes.CHAR(1),
allowNull: false,
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'
......
......@@ -18,24 +18,12 @@ module.exports = app => {
type: DataTypes.STRING(50),
allowNull: true
},
plate_number: {
type: DataTypes.STRING(64),
allowNull: true
},
name: {
type: DataTypes.STRING(64),
allowNull: true
},
mobile: {
type: DataTypes.STRING(11),
allowNull: true
},
merchant_type: {
merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: true
allowNull: false
},
pmerchant_name: {
type: DataTypes.STRING(32),
merchant_name: {
type: DataTypes.STRING(64),
allowNull: true
},
enter_time: {
......@@ -83,21 +71,14 @@ module.exports = app => {
allowNull: true,
defaultValue: '0'
},
erp_mobile: {
type: DataTypes.STRING(32),
allowNull: true
},
current_mileage: {
type: "DOUBLE(11,4)",
allowNull: true
},
vehicle_id: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_id: {
last_year_shops: {
type: DataTypes.INTEGER(11),
allowNull: false
allowNull: true,
defaultValue: '0'
},
created_by: {
type: DataTypes.STRING(64),
......@@ -119,55 +100,6 @@ module.exports = app => {
type: DataTypes.CHAR(1),
allowNull: false,
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'
......
/* 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 @@
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_biz_delivery', {
const Model = app.model.define('dj_system_login_log', {
id: {
type: DataTypes.INTEGER(11),
type: DataTypes.BIGINT,
allowNull: false,
primaryKey: 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: {
type: DataTypes.INTEGER(11),
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(100),
allowNull: false
},
biz_type: {
type: DataTypes.INTEGER(4),
allowNull: true
},
device_type: {
type: DataTypes.INTEGER(6),
type: DataTypes.STRING(256),
allowNull: true
},
delivery_total: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
login_name: {
type: DataTypes.STRING(50),
allowNull: false
},
active_total: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
login_time: {
type: DataTypes.DATE,
allowNull: false
},
create_time: {
type: DataTypes.DATE,
......@@ -57,7 +35,7 @@ module.exports = app => {
allowNull: true
}
}, {
tableName: 'glsx_biz_delivery'
tableName: 'dj_system_login_log'
});
Model.associate = function() {
......
......@@ -3,51 +3,61 @@
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_basic_clues', {
const Model = app.model.define('fmrs_device_info', {
id: {
type: DataTypes.INTEGER(11),
type: DataTypes.BIGINT,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
sn: {
type: DataTypes.STRING(32),
allowNull: true,
unique: true
},
imsi: {
type: DataTypes.STRING(32),
allowNull: true
},
stand_no: {
type: DataTypes.STRING(64),
sim_no: {
type: DataTypes.STRING(32),
allowNull: true
},
name: {
type: DataTypes.STRING(64),
iccid: {
type: DataTypes.STRING(32),
allowNull: true
},
mobile: {
type: DataTypes.STRING(16),
device_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
biz_type: {
type: DataTypes.INTEGER(1),
device_name: {
type: DataTypes.STRING(24),
allowNull: true
},
clue_time: {
status: {
type: DataTypes.INTEGER(1),
allowNull: true,
defaultValue: '1'
},
active_time: {
type: DataTypes.DATE,
allowNull: true
},
arrshop_time: {
type: DataTypes.DATE,
period: {
type: DataTypes.INTEGER(11),
allowNull: true
},
price: {
type: DataTypes.FLOAT,
pk_begin_time: {
type: DataTypes.DATE,
allowNull: true
},
merchant_id: {
type: DataTypes.INTEGER(11),
allowNull: false
pk_end_time: {
type: DataTypes.DATE,
allowNull: true
},
merchant_name: {
type: DataTypes.STRING(64),
active_month: {
type: DataTypes.STRING(16),
allowNull: true
},
create_time: {
......@@ -59,7 +69,7 @@ module.exports = app => {
allowNull: true
}
}, {
tableName: 'glsx_basic_clues'
tableName: 'fmrs_device_info'
});
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 @@
module.exports = app => {
const DataTypes = app.Sequelize;
const Model = app.model.define('glsx_basic_devices', {
const Model = app.model.define('tsp_device_info', {
id: {
type: DataTypes.INTEGER(11),
type: DataTypes.BIGINT,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
sn: {
type: DataTypes.STRING(32),
allowNull: true
allowNull: true,
unique: true
},
sim_phone: {
imsi: {
type: DataTypes.STRING(32),
allowNull: true
},
biz_type: {
type: DataTypes.INTEGER(4),
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),
simno: {
type: DataTypes.STRING(32),
allowNull: true
},
latest_provname: {
iccid: {
type: DataTypes.STRING(32),
allowNull: true
},
latest_provcode: {
type: DataTypes.INTEGER(6),
device_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
user_phone: {
type: DataTypes.STRING(32),
device_name: {
type: DataTypes.STRING(24),
allowNull: true
},
user_standno: {
package_name: {
type: DataTypes.STRING(32),
allowNull: true
},
drive_days: {
type: DataTypes.INTEGER(11),
allowNull: true
status: {
type: DataTypes.INTEGER(1),
allowNull: true,
defaultValue: '1'
},
avr_day_miles: {
type: "DOUBLE(12,2)",
active_time: {
type: DataTypes.DATE,
allowNull: true
},
pk_begin_time: {
......@@ -110,8 +56,8 @@ module.exports = app => {
type: DataTypes.DATE,
allowNull: true
},
datafrom: {
type: DataTypes.STRING(32),
active_month: {
type: DataTypes.STRING(16),
allowNull: true
},
create_time: {
......@@ -123,11 +69,11 @@ module.exports = app => {
allowNull: true
}
}, {
tableName: 'glsx_basic_devices'
tableName: 'tsp_device_info'
});
Model.associate = function() {
}
return Model;
......
/*
* @Author: limin
* @Date: 2019-11-21 11:19:15
* @Last Modified by: chenwq
* @Last Modified time: 2020-06-19 11:45:09
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 17:04:58
*/
module.exports = (app) => {
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/shop/findAll", app.controller.biz.shop.findAll);
app.router.get("/biz/record/findAll", app.controller.biz.record.findAll);
app.router.get("/biz/merchant/findAll", app.controller.biz.merchant.findAll);
app.router.get("/biz/devices/findAll", app.controller.biz.devices.findAll);
app.router.get("/biz/delivery/findAll", app.controller.biz.delivery.findAll);
app.router.get("/biz/delivery/findCount", app.controller.biz.delivery.findCount);
app.router.get("/biz/clues/findAll", app.controller.biz.clues.findAll);
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/loss/findAll', app.controller.biz.loss.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/collision/findAll', app.controller.biz.collision.findAll)
app.router.get('/biz/record/findAll', app.controller.biz.record.findAll)
app.router.get('/biz/merchant/findAll', app.controller.biz.merchant.findAll)
app.router.get('/biz/devices/findAll', app.controller.biz.devices.findAll)
app.router.get('/biz/delivery/findAll', app.controller.biz.delivery.findAll)
app.router.get('/biz/delivery/findCount', app.controller.biz.delivery.findCount)
app.router.get('/biz/clues/findAll', app.controller.biz.clues.findAll)
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
* @Date: 2020-06-16 10:02:39
* @Last Modified by: chenwq
* @Last Modified time: 2020-06-19 16:14:30
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:31:36
* 设备信息
*/
......@@ -19,10 +19,10 @@ class DevicesService extends Service {
*/
_reg_models_alias_() {
const {
GlsxBasicDevices,
DjDeviceInfo,
DjSystemMerchant
} = this.app.model.Biz;
this.GBDE = GlsxBasicDevices;
this.MDDI = DjDeviceInfo;
this.MDSM = DjSystemMerchant;
}
......@@ -95,25 +95,25 @@ class DevicesService extends Service {
where[item.sqlName] = searcher[item.name]
}
})
let date = await this.GBDE.findAndCountAll({
attributes: {
include: [
[col('dj_system_merchant.merchant_name'), 'shop_merchant_name']
]
},
let date = await this.MDDI.findAndCountAll({
// attributes: {
// include: [
// [col('dj_system_merchant.merchant_name'), 'shop_merchant_name']
// ]
// },
offset,
limit: +size,
where,
raw: true,
include: [{
model: this.MDSM,
as: 'dj_system_merchant',
attributes: [],
associate: this.GBDE.belongsTo(this.MDSM, {
foreignKey: 'shop_merchant_id',
targetKey: 'merchant_id'
})
}]
// include: [{
// model: this.MDSM,
// as: 'dj_system_merchant',
// attributes: [],
// associate: this.MDDI.belongsTo(this.MDSM, {
// foreignKey: 'shop_merchant_id',
// targetKey: 'merchant_id'
// })
// }]
})
date.rows && date.rows.forEach(item => {
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
* @Date: 2019-11-21 11:18:37
* @Last Modified by: chenwq
* @Last Modified time: 2020-09-08 15:02:37
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 15:51:44
*/
const Service = require("egg").Service;
......
/*
* @Author: limin
* @Date: 2019-11-21 11:18:37
* @Last Modified by: limin
* @Last Modified time: 2020-04-20 13:54:35
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 18:02:28
*/
const Service = require("egg").Service;
......@@ -55,7 +55,7 @@ class MaintainService extends Service {
const {
Op
} = this.app.Sequelize;
let where = { is_new: isNew };
let where = { };
if (searchValue) {
const __like = `%${searchValue}%`;
where = {
......
/*
* @Author: chenwq
* @Date: 2020-06-12 15:19:31
* @Last Modified by: chenwq
* @Last Modified time: 2020-06-18 11:29:42
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 16:28:01
*/
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
* @Date: 2019-11-16 09:26:53
* @Last Modified by: chenwq
* @Last Modified time: 2020-09-01 15:36:55
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 18:05:32
*/
/* eslint valid-jsdoc: "off" */
"use strict";
'use strict'
/**
* @param {Egg.EggAppInfo} app app info
......@@ -17,89 +17,89 @@ module.exports = app => {
* built-in config
* @type {Egg.EggAppConfig}
**/
const config = (exports = {});
const config = (exports = {})
// 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
// config.middleware = [ 'errorHandler'];
// config.middleware = [ 'errorHandler']
config.onerror = {
//全局异常捕获
// 全局异常捕获
all(err, ctx) {
// 在此处定义针对所有响应类型的错误处理方法
// 注意,定义了 config.all 之后,其他错误处理方法不会再生效
// 所有的异常都在 app 上触发一个 error 事件,框架会记录一条错误日志
ctx.app.emit("error", err, ctx);
const status = err.status || 500;
ctx.app.emit('error', err, ctx)
const status = err.status || 500
// 生产环境时 500 错误的详细错误内容不返回给客户端,因为可能包含敏感信息
const error =
status === 500 && ctx.app.config.env === "prod"
? "Internal Server Error"
: err.message;
status === 500 && ctx.app.config.env === 'prod'
? 'Internal Server Error'
: err.message
// 从 error 对象上读出各个属性,设置到响应中
ctx.body = JSON.stringify(
ctx.response.ServerResponse.Error({ message: error })
);
)
if (status === 422) {
ctx.body.detail = err.errors;
ctx.body.detail = err.errors
}
ctx.status = status;
ctx.status = status
}
// html(err, ctx) {
// // html hander
// ctx.body = '<h3>error</h3>';
// ctx.status = 500;
// },
// json(err, ctx) {
// // json hander
// ctx.body = { message: 'error' };
// ctx.status = 500;
// },
// jsonp(err, ctx) {
// // 一般来说,不需要特殊针对 jsonp 进行错误定义,jsonp 的错误处理会自动调用 json 错误处理,并包装成 jsonp 的响应格式
// },
};
// html(err, ctx) {
// // html hander
// ctx.body = '<h3>error</h3>'
// ctx.status = 500
// },
// json(err, ctx) {
// // json hander
// ctx.body = { message: 'error' }
// ctx.status = 500
// },
// jsonp(err, ctx) {
// // 一般来说,不需要特殊针对 jsonp 进行错误定义,jsonp 的错误处理会自动调用 json 错误处理,并包装成 jsonp 的响应格式
// },
}
// add your user config here
// const userConfig = {
config.jwt = {
secret: "glsx-insurence-egg-server" //自定义 token 的加密条件字符串
};
secret: 'glsx-insurence-egg-server' // 自定义 token 的加密条件字符串
}
config.cors = {
// origin: "http://192.168.2.222:8085",
origin: 'http://192.168.2.2:8085',
credentials: true,
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
};
}
config.security = {
csrf: {
enable: false,
ignoreJSON: true
},
// 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 = {
client: {
port: 6379, // Redis port
host: "127.0.0.1", // Redis host
password: "",
host: '127.0.0.1', // Redis host
password: '',
db: 0
}
};
}
// 改变请求ip
// config.cluster = {
// listen: {
// port: 8000,
// hostname: '192.168.2.201'
// }
// };
// }
config.validate = {
// convert: false,
// validateRoot: false,
};
}
config.sequelize = {
timezone: '+08:00',
define: {
......@@ -108,26 +108,26 @@ module.exports = app => {
timestamps: false // 不自动维护时间戳 [ created_at、updated_at ]
},
dialectOptions: {
dateStrings: true, //格式化datetime
dateStrings: true, // 格式化datetime
typeCast: true
}
};
}
config.swaggerdoc = {
dirScanner: "./app/controller",
dirScanner: './app/controller',
apiInfo: {
title: "广联运营",
description: "swagger-ui for egg",
version: "1.0.0"
title: '广联运营',
description: 'swagger-ui for egg',
version: '1.0.0'
},
schemes: ["http", "https"],
consumes: ["application/json"],
produces: ["application/json"],
schemes: ['http', 'https'],
consumes: ['application/json'],
produces: ['application/json'],
securityDefinitions: {},
enableSecurity: false,
// enableValidate: true,
routerMap: true,
enable: true
};
return config;
};
}
return config
}
/*
* @Author: limin
* @Date: 2019-11-16 09:26:47
* @Last Modified by: limin
* @Last Modified time: 2020-04-15 10:59:34
* @Last Modified by: huyue
* @Last Modified time: 2020-11-23 10:19:32
*/
/* eslint valid-jsdoc: "off" */
"use strict";
const path = require("path");
'use strict'
const path = require('path')
/**
* @param {Egg.EggAppInfo} appInfo app info
*/
......@@ -17,21 +17,21 @@ module.exports = appInfo => {
* built-in config
* @type {Egg.EggAppConfig}
**/
const config = (exports = {});
const config = (exports = {})
config.logger = {
level: "INFO",
dir: path.join(__dirname, "../logs/dev") // 保存路径为工程路径下`logs/dev`
};
level: 'INFO',
dir: path.join(__dirname, '../logs/dev') // 保存路径为工程路径下`logs/dev`
}
// add your user config here
// myAppName: 'egg',
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
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!