Commit baf333b9 by 孙亚楠

Merge branch 'xggsve-order-dev' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order-dev

parents e4fd4a38 47b28416
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class ObusinessmenDao extends Dao { class ObusinessmenDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(ObusinessmenDao)); super(Dao.getModelName(ObusinessmenDao));
} }
async countByCondition(params) {
let sql = [];
sql.push("SELECT");
sql.push("COUNT(1) AS num");
sql.push("FROM `o_businessmen` t1");
sql.push("WHERE 1 = 1");
}
async listByCondition(params) {
sql.push("SELECT");
sql.push("t1.*");
sql.push("FROM `o_businessmen` t1");
sql.push("WHERE 1 = 1");
this.setCondition(sql, params);
}
setCondition(sql, params) {
if(params.order_id) {
sql.push("AND t1.order_id = :order_id");
}
if(params.name) {
params.name_like = "%" + params.name + "%";
sql.push("AND t1.name = :name_like");
}
if(params.bd_id) {
sql.push("AND t1.bd_id = :bd_id");
}
if(params.bd_path) {
params.bd_path_like = "%" + params.bd_path + "%";
sql.push("AND t1.bd_path = :bd_path_like");
}
if(params.order_id) {
sql.push("AND t1.order_id = :order_id");
}
if(params.legal_name) {
sql.push("AND t1.legal_name = :legal_name");
}
if(params.legal_mobile) {
sql.push("AND t1.legal_mobile = :legal_mobile");
}
if(params.legal_idcard) {
sql.push("AND t1.legal_idcard = :legal_idcard");
}
if(params.credit_code) {
sql.push("AND t1.credit_code = :credit_code");
}
}
} }
module.exports = ObusinessmenDao; module.exports = ObusinessmenDao;
\ No newline at end of file
...@@ -7,7 +7,6 @@ module.exports = function (db, DataTypes) { ...@@ -7,7 +7,6 @@ module.exports = function (db, DataTypes) {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单id' }, order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单id' },
merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, comment:'商户id 为了司机宝' }, merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, comment:'商户id 为了司机宝' },
channel_order_no: { type: DataTypes.STRING, field: 'channel_order_no', allowNull: true, defaultValue:'', comment:'渠道订单号 为了司机宝'}, channel_order_no: { type: DataTypes.STRING, field: 'channel_order_no', allowNull: true, defaultValue:'', comment:'渠道订单号 为了司机宝'},
status: {type: DataTypes.STRING, field: 'status', allowNull: true,defaultValue:'2000', comment:'业务状态: 2000办理中, 2010待签约, 2020已完成' },
legal_name: { type: DataTypes.STRING, field: 'legal_name', allowNull: false,defaultValue:'', comment:'法人姓名'}, legal_name: { type: DataTypes.STRING, field: 'legal_name', allowNull: false,defaultValue:'', comment:'法人姓名'},
legal_mobile: {type: DataTypes.STRING, field: 'legal_mobile', allowNull: true,defaultValue:'', comment:'法人电话'}, legal_mobile: {type: DataTypes.STRING, field: 'legal_mobile', allowNull: true,defaultValue:'', comment:'法人电话'},
legal_idcard: { type: DataTypes.STRING, field: 'legal_idcard', allowNull: true, defaultValue:'',comment:'法人身份证号'}, legal_idcard: { type: DataTypes.STRING, field: 'legal_idcard', allowNull: true, defaultValue:'',comment:'法人身份证号'},
...@@ -49,6 +48,8 @@ module.exports = function (db, DataTypes) { ...@@ -49,6 +48,8 @@ module.exports = function (db, DataTypes) {
sign_notes: {type: DataTypes.STRING, field: 'sign_notes', allowNull: true, defaultValue:'', comment:'签约备注' }, sign_notes: {type: DataTypes.STRING, field: 'sign_notes', allowNull: true, defaultValue:'', comment:'签约备注' },
sign_time: {type: DataTypes.DATE, field: 'sign_time', allowNull: true, defaultValue:null, comment:'签约时间' }, sign_time: {type: DataTypes.DATE, field: 'sign_time', allowNull: true, defaultValue:null, comment:'签约时间' },
is_create_account: {type: DataTypes.BOOLEAN, field: 'is_create_account', allowNull: true, defaultValue:false, comment:'是否建帐' }, is_create_account: {type: DataTypes.BOOLEAN, field: 'is_create_account', allowNull: true, defaultValue:false, comment:'是否建帐' },
bd_id: {type: DataTypes.INTEGER, field: 'bd_id', allowNull: true, defaultValue:'', comment:'业务员id' },
bd_path: {type: DataTypes.STRING, field: 'bd_path', allowNull: true, defaultValue:'', comment:'业务员权限路径' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW }, updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true } deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
......
...@@ -15,8 +15,8 @@ module.exports = function (db, DataTypes) { ...@@ -15,8 +15,8 @@ module.exports = function (db, DataTypes) {
assign_user_id: {type: DataTypes.BIGINT, field: 'assign_user_id', allowNull: true, defaultValue:'0', comment:'分配人id' }, assign_user_id: {type: DataTypes.BIGINT, field: 'assign_user_id', allowNull: true, defaultValue:'0', comment:'分配人id' },
deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: true, defaultValue:'', comment:'交付商id common微服务下' }, deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: true, defaultValue:'', comment:'交付商id common微服务下' },
desc: {type: DataTypes.STRING, field: 'desc', allowNull: true, defaultValue:'', comment:'订单信息' }, desc: {type: DataTypes.STRING, field: 'desc', allowNull: true, defaultValue:'', comment:'订单信息' },
bd_id: {type: DataTypes.STRING, field: 'bd_id', allowNull: true, defaultValue:'', comment:'业务员id' }, bd_id: {type: DataTypes.INTEGER, field: 'bd_id', allowNull: true, defaultValue:'', comment:'业务员id' },
bd_path: {type: DataTypes.BIGINT, field: 'bd_path', allowNull: true, defaultValue:'', comment:'业务员权限路径' }, bd_path: {type: DataTypes.STRING, field: 'bd_path', allowNull: true, defaultValue:'', comment:'业务员权限路径' },
service_items: {type: DataTypes.STRING, field: 'service_items', allowNull: true, defaultValue:'', comment:'服务项json' }, service_items: {type: DataTypes.STRING, field: 'service_items', allowNull: true, defaultValue:'', comment:'服务项json' },
service_remark: {type: DataTypes.STRING, field: 'service_remark', allowNull: true, defaultValue:'', comment:'服务信息备注' }, service_remark: {type: DataTypes.STRING, field: 'service_remark', allowNull: true, defaultValue:'', comment:'服务信息备注' },
source_id: {type: DataTypes.BIGINT, field: 'source_id', allowNull: true, defaultValue:0, comment:'来源id' }, source_id: {type: DataTypes.BIGINT, field: 'source_id', allowNull: true, defaultValue:0, comment:'来源id' },
......
...@@ -104,6 +104,60 @@ class ObusinessmenService extends ServiceBase { ...@@ -104,6 +104,60 @@ class ObusinessmenService extends ServiceBase {
} }
} }
async businessmenPage(params) {
let currentPage = Number(params.currentPage || 1);
let pageSize = Number(params.pageSize || 10);
let order_id = this.trim(params.order_id);
let name = this.trim(params.name);
let bd_id = this.trim(params.bd_id);
let bd_path = this.trim(params.bd_path);
let legal_name = this.trim(params.legal_name);
let legal_mobile = this.trim(params.legal_mobile);
let legal_idcard = this.trim(params.legal_idcard);
let credit_code = this.trim(params.credit_code);
var where = {};
var orderby = [
["id", 'desc']
];
if (bdId) {
where.merchant_id = bdId;
}
if (bdPath && bdPath.length > 0) {
where.id = {
[this.db.Op.like]: bdPath + "%"
}
}
if (userId) {
where.userId = userId;
}
if (ostatuses && ostatuses.length > 0) {
where.ostatus = {
[this.db.Op.in]: ostatuses
}
}
this.addWhereTime(where, 'created_at', params.createdBegin, params.createdEnd);
var page = await this.getPageList(currentPage, pageSize, where, orderby, null);
if (page && page.rows) {
for (var row of page.rows) {
await this.dao.setRowCodeName(row, "status");
await this.dao.setRowCodeName(row, "ostatus");
await this.dao.setRowCodeName(row, "deliverType");
this.handleDate(row, ["created_at", "assignTime"], null, -8);
}
}
return system.getResultSuccess(page);
}
} }
module.exports = ObusinessmenService; module.exports = ObusinessmenService;
\ No newline at end of file
...@@ -582,6 +582,8 @@ class OorderstatusService extends ServiceBase { ...@@ -582,6 +582,8 @@ class OorderstatusService extends ServiceBase {
if (!params.business_gov_file) { if (!params.business_gov_file) {
return system.getResult(null, `参数错误 工商官方文件不能为空`); return system.getResult(null, `参数错误 工商官方文件不能为空`);
} }
let _order = params._order;
let _obusinessmenProperty = {}; let _obusinessmenProperty = {};
_obusinessmenProperty.name = this.trim(params.name); _obusinessmenProperty.name = this.trim(params.name);
_obusinessmenProperty.credit_code = this.trim(params.credit_code); _obusinessmenProperty.credit_code = this.trim(params.credit_code);
...@@ -590,8 +592,9 @@ class OorderstatusService extends ServiceBase { ...@@ -590,8 +592,9 @@ class OorderstatusService extends ServiceBase {
_obusinessmenProperty.reg_date = this.trim(params.reg_date); _obusinessmenProperty.reg_date = this.trim(params.reg_date);
_obusinessmenProperty.business_img = this.trim(params.business_img); _obusinessmenProperty.business_img = this.trim(params.business_img);
_obusinessmenProperty.business_gov_file = this.trim(params.business_gov_file); _obusinessmenProperty.business_gov_file = this.trim(params.business_gov_file);
_obusinessmenProperty.bd_id = this.trim(params.bd_id);
_obusinessmenProperty.bd_path = this.trim(params.bd_path);
let _order = params._order;
let orderProperty = {}; let orderProperty = {};
orderProperty.id = _order.id; orderProperty.id = _order.id;
orderProperty.status = this.trim(params.status); orderProperty.status = this.trim(params.status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment