Commit 4acfb3ae by sxy

remove: 公司主体

parent ac808f10
......@@ -27,10 +27,10 @@ class DbFactory {
console.log("init models....");
}
async initRelations() {
this.db.models.dataauth.belongsTo(this.db.models.user, { constraints: false, });
/*建立用户和角色之间的关系*/
this.db.models.user.belongsToMany(this.db.models.role, { as: "Roles", through: 'p_userrole', constraints: false, });
this.db.models.role.belongsToMany(this.db.models.user, { as: "Users", through: 'p_userrole', constraints: false, });
// this.db.models.dataauth.belongsTo(this.db.models.user, { constraints: false, });
// /*建立用户和角色之间的关系*/
// this.db.models.user.belongsToMany(this.db.models.role, { as: "Roles", through: 'p_userrole', constraints: false, });
// this.db.models.role.belongsToMany(this.db.models.user, { as: "Users", through: 'p_userrole', constraints: false, });
/*组织机构自引用*/
//this.db.models.org.belongsTo(this.db.models.org,{constraints: false,});
//this.db.models.org.hasMany(this.db.models.org,{constraints: false,});
......@@ -44,24 +44,24 @@ class DbFactory {
// this.db.models.user.belongsTo(this.db.models.org,{constraints: false,});
// this.db.models.org.hasMany(this.db.models.user,{constraints: false,});
this.db.models.user.belongsTo(this.db.models.app, { constraints: false, });
this.db.models.role.belongsTo(this.db.models.app, { constraints: false, });
// this.db.models.user.belongsTo(this.db.models.app, { constraints: false, });
// this.db.models.role.belongsTo(this.db.models.app, { constraints: false, });
this.db.models.auth.belongsTo(this.db.models.app, { constraints: false, });
this.db.models.auth.belongsTo(this.db.models.company, { constraints: false, });
this.db.models.auth.belongsTo(this.db.models.role, { constraints: false, });
// this.db.models.auth.belongsTo(this.db.models.app, { constraints: false, });
// this.db.models.auth.belongsTo(this.db.models.company, { constraints: false, });
// this.db.models.auth.belongsTo(this.db.models.role, { constraints: false, });
this.db.models.app.belongsTo(this.db.models.user, { as: "creator", constraints: false, });
// this.db.models.app.belongsTo(this.db.models.user, { as: "creator", constraints: false, });
this.db.models.user.belongsTo(this.db.models.company, { constraints: false, });
this.db.models.role.belongsTo(this.db.models.company, { constraints: false, });
// this.db.models.user.belongsTo(this.db.models.company, { constraints: false, });
// this.db.models.role.belongsTo(this.db.models.company, { constraints: false, });
// this.db.models.org.belongsTo(this.db.models.company,{constraints: false,});
this.db.models.route.belongsTo(this.db.models.app, { constraints: false, });
this.db.models.plugin.belongsTo(this.db.models.app, { constraints: false, });
// this.db.models.route.belongsTo(this.db.models.app, { constraints: false, });
// this.db.models.plugin.belongsTo(this.db.models.app, { constraints: false, });
// 商机表 1:1 方案表
this.db.models.scheme.belongsTo(this.db.models.bizopt, { constraints: false, });
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig();
const appconfig = system.getSysConfig();
module.exports = (db, DataTypes) => {
return db.define("company", {
name: {
......@@ -29,46 +29,46 @@ module.exports = (db, DataTypes) => {
},
orgJson: DataTypes.TEXT,//功能清
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'p_company',
validate: {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'p_company',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
......@@ -5,7 +5,8 @@ const appconfig = system.getSysConfig();
* 公司主体表
*/
module.exports = (db, DataTypes) => {
return db.define("company", {
//TODO:
return db.define("company1", {
name: {
allowNull: false,
type: DataTypes.STRING
......
......@@ -6,7 +6,6 @@ class DeliverService extends ServiceBase {
constructor() {
super("delivery", ServiceBase.getDaoName(DeliverService));
this.cacheinfoDao = system.getObject("db.delivery.cacheinfoDao");
this.companyDao = system.getObject("db.delivery.companyDao");
this.materialDao = system.getObject("db.delivery.materialDao");
this.statuslogDao = system.getObject("db.bizchance.statuslogDao");
this.qualificationDao = system.getObject("db.delivery.qualificationDao");
......@@ -34,10 +33,8 @@ class DeliverService extends ServiceBase {
* 1.此状态下是否可以提交材料
* 2.同步暂存数据表
* 3.存储到材料表
* 4.提取 公司主体信息 存储到公司表
* 5.TODO:公司表 与 交付单 表 关联
* 6.更改 交付单流转状态
* 7.推送到腾讯
* 4.更改 交付单流转状态
* 5.推送到腾讯
*/
const deliverData = await this.dao.findOne({
id: pobj.deliver_id
......@@ -64,11 +61,7 @@ class DeliverService extends ServiceBase {
status_code: system.SERVERSESTATUS.SUBMITING
}, t);
}
await this.companyDao.createOrUpdate({
...pobj.cache_info.proposerInfo.businessLicense,
lastContactInfo: pobj.cache_info.proposerInfo.contactInfo,
firstBuyTime: deliverData.created_at
}, t);
return "SUCCESS"
});
}
......
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