Commit baf333b9 by 孙亚楠

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

parents e4fd4a38 47b28416
...@@ -80,151 +80,148 @@ class ActionAPI extends APIBase { ...@@ -80,151 +80,148 @@ class ActionAPI extends APIBase {
case "allProcess": // 查询业务进度 case "allProcess": // 查询业务进度
opResult = await this.oprocessSve.allNames(action_body); opResult = await this.oprocessSve.allNames(action_body);
break; break;
// 个体户
case "queryObusinessmen": //查询个体工商户信息 case "queryObusinessmen": //查询个体工商户信息
opResult = await this.obusinessmenSve.queryObusinessmen(action_body); opResult = await this.obusinessmenSve.queryObusinessmen(action_body);
break; break;
case "businessmenPage":
case "signing": //签约 opResult = await this.businessmenSve.apiPage(action_body);
opResult = await this.obusinessmenSve.signing(action_body);
break;
case "createAccount": //签约
opResult = await this.obusinessmenSve.createAccount(action_body);
break; break;
//******************************************************************** */ //******************************************************************** */
// 订单 // // 订单
case "createOrder": //创建订单 // case "createOrder": //创建订单
opResult = await this.iborderbaseSve.apiCreateOrder(action_body); // opResult = await this.iborderbaseSve.apiCreateOrder(action_body);
break;
case "completedOrder": //完善信息接口
opResult = await this.iborderbaseSve.apiCompletedOrder(action_body);
break;
case "handling": //订单办理接口
opResult = await this.iborderbaseSve.apiHandling(action_body);
break;
// case "orders": //订单列表
// opResult = await this.iborderbaseSve.apiOrders(action_body);
// break; // break;
case "addOrder": // case "completedOrder": //完善信息接口
opResult = await this.iborderSve.apiAdd(action_body); // opResult = await this.iborderbaseSve.apiCompletedOrder(action_body);
break;
case "updOrder":
opResult = await this.iborderSve.apiUpd(action_body);
break;
// -------------------
case "allOrderList":
opResult = await this.iborderSve.apiAllList(action_body);
break;
// case "orderInfo":
// opResult = await this.iborderSve.apiInfo(action_body);
// break; // break;
// case "orderInfoAll": // case "handling": //订单办理接口
// opResult = await this.iborderSve.apiAllInfo(action_body); // opResult = await this.iborderbaseSve.apiHandling(action_body);
// break;
// // case "orders": //订单列表
// // opResult = await this.iborderbaseSve.apiOrders(action_body);
// // break;
// case "addOrder":
// opResult = await this.iborderSve.apiAdd(action_body);
// break;
// case "updOrder":
// opResult = await this.iborderSve.apiUpd(action_body);
// break;
//
// // -------------------
// case "allOrderList":
// opResult = await this.iborderSve.apiAllList(action_body);
// break;
// // case "orderInfo":
// // opResult = await this.iborderSve.apiInfo(action_body);
// // break;
// // case "orderInfoAll":
// // opResult = await this.iborderSve.apiAllInfo(action_body);
// // break;
// case "byChannelOrderId":
// opResult = await this.iborderSve.apiByChannelOrderId(action_body);
// break;
//
//
// case "orderEdit":
// opResult = await this.iborderSve.apiEdit(action_body);
// break;
// case "orderAssign":
// opResult = await this.iborderSve.apiAssign(action_body);
// break;
// case "myOrderPage":
// opResult = await this.iborderSve.apiMyPage(action_body);
// break;
// case "orderPay":
// opResult = await this.iborderSve.apiOrderPay(action_body);
// break;
// case "orderClose":
// opResult = await this.iborderSve.apiOrderClose(action_body);
// break;
// case "closeOrderById":
// opResult = await this.iborderSve.apiCloseById(action_body);
// break;
// case "orderComplete":
// opResult = await this.iborderSve.apiComplete(action_body);
// break;
// case "orderByDeliverId":
// opResult = await this.iborderSve.apiByDeliverId(action_body);
// break;
//
//
// // 订单办理
// case "orderDeliverList":
// opResult = await this.iborderdeliverSve.apiPage(action_body);
// break;
// case "orderDeliverHandle":
// opResult = await this.iborderdeliverSve.apiHandle(action_body);
// break;
// case "orderDeliverInfo":
// opResult = await this.iborderdeliverSve.apiInfo(action_body);
// break;
// case "orderDeliverEdit":
// opResult = await this.iborderdeliverSve.apiEdit(action_body);
// break;
//
// case "orderDeliverAudit":
// opResult = await this.iborderdeliverSve.apiAudit(action_body);
// break;
//
// case "orderDeliverClose":
// opResult = await this.iborderdeliverSve.apiClose(action_body);
// break;
//
// // 个体户管理
// case "businessmenByOrderId":
// opResult = await this.businessmenSve.apiByOrderId(action_body);
// break;
// case "businessmenByChannelOrderNo":
// opResult = await this.businessmenSve.apiByChannelOrderNo(action_body);
// break;
// case "businessmenNameList":
// opResult = await this.businessmenSve.apiNameList(action_body);
// break;
// case "businessmenPage":
// opResult = await this.businessmenSve.apiPage(action_body);
// break;
// case "businessmenInfo":
// opResult = await this.businessmenSve.apiInfo(action_body);
// break;
// case "businessmenSign":
// opResult = await this.businessmenSve.apiSign(action_body);
// break;
// case "businessmenSignPage":
// opResult = await this.businessmenSve.apiSignPage(action_body);
// break;
// case "businessmenInfoPage":
// opResult = await this.businessmenSve.apiInfoPage(action_body);
// break;
// case "businessmenUserPage":
// opResult = await this.businessmenSve.apiUserPage(action_body);
// break;
// case "businessmenDeliverPage":
// opResult = await this.businessmenSve.apiDeliverPage(action_body);
// break;
// case "addBusinessmenContract":
// opResult = await this.businessmenSve.apiAddContract(action_body);
// break;
//
// case "businessmenCompleteMapByCreditCodes":
// opResult = await this.businessmenSve.apiCompleteMapByCreditCodes(action_body);
// break;
//
// // 统计数据
// case "statTransData":
// opResult = await this.iborderSve.apiStatTransData(action_body);
// break;
// case "statBusinessData":
// opResult = await this.iborderSve.apiStatBusinessData(action_body);
// break;
// case "statDeliverData":
// opResult = await this.iborderdeliverSve.apiStatDeliverData(action_body);
// break; // break;
case "byChannelOrderId":
opResult = await this.iborderSve.apiByChannelOrderId(action_body);
break;
case "orderEdit":
opResult = await this.iborderSve.apiEdit(action_body);
break;
case "orderAssign":
opResult = await this.iborderSve.apiAssign(action_body);
break;
case "myOrderPage":
opResult = await this.iborderSve.apiMyPage(action_body);
break;
case "orderPay":
opResult = await this.iborderSve.apiOrderPay(action_body);
break;
case "orderClose":
opResult = await this.iborderSve.apiOrderClose(action_body);
break;
case "closeOrderById":
opResult = await this.iborderSve.apiCloseById(action_body);
break;
case "orderComplete":
opResult = await this.iborderSve.apiComplete(action_body);
break;
case "orderByDeliverId":
opResult = await this.iborderSve.apiByDeliverId(action_body);
break;
// 订单办理
case "orderDeliverList":
opResult = await this.iborderdeliverSve.apiPage(action_body);
break;
case "orderDeliverHandle":
opResult = await this.iborderdeliverSve.apiHandle(action_body);
break;
case "orderDeliverInfo":
opResult = await this.iborderdeliverSve.apiInfo(action_body);
break;
case "orderDeliverEdit":
opResult = await this.iborderdeliverSve.apiEdit(action_body);
break;
case "orderDeliverAudit":
opResult = await this.iborderdeliverSve.apiAudit(action_body);
break;
case "orderDeliverClose":
opResult = await this.iborderdeliverSve.apiClose(action_body);
break;
// 个体户管理
case "businessmenByOrderId":
opResult = await this.businessmenSve.apiByOrderId(action_body);
break;
case "businessmenByChannelOrderNo":
opResult = await this.businessmenSve.apiByChannelOrderNo(action_body);
break;
case "businessmenNameList":
opResult = await this.businessmenSve.apiNameList(action_body);
break;
case "businessmenPage":
opResult = await this.businessmenSve.apiPage(action_body);
break;
case "businessmenInfo":
opResult = await this.businessmenSve.apiInfo(action_body);
break;
case "businessmenSign":
opResult = await this.businessmenSve.apiSign(action_body);
break;
case "businessmenSignPage":
opResult = await this.businessmenSve.apiSignPage(action_body);
break;
case "businessmenInfoPage":
opResult = await this.businessmenSve.apiInfoPage(action_body);
break;
case "businessmenUserPage":
opResult = await this.businessmenSve.apiUserPage(action_body);
break;
case "businessmenDeliverPage":
opResult = await this.businessmenSve.apiDeliverPage(action_body);
break;
case "addBusinessmenContract":
opResult = await this.businessmenSve.apiAddContract(action_body);
break;
case "businessmenCompleteMapByCreditCodes":
opResult = await this.businessmenSve.apiCompleteMapByCreditCodes(action_body);
break;
// 统计数据
case "statTransData":
opResult = await this.iborderSve.apiStatTransData(action_body);
break;
case "statBusinessData":
opResult = await this.iborderSve.apiStatBusinessData(action_body);
break;
case "statDeliverData":
opResult = await this.iborderdeliverSve.apiStatDeliverData(action_body);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
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