Commit 4acfb3ae by sxy

remove: 公司主体

parent ac808f10
...@@ -27,10 +27,10 @@ class DbFactory { ...@@ -27,10 +27,10 @@ class DbFactory {
console.log("init models...."); console.log("init models....");
} }
async initRelations() { async initRelations() {
this.db.models.dataauth.belongsTo(this.db.models.user, { 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.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.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.belongsTo(this.db.models.org,{constraints: false,});
//this.db.models.org.hasMany(this.db.models.org,{constraints: false,}); //this.db.models.org.hasMany(this.db.models.org,{constraints: false,});
...@@ -44,24 +44,24 @@ class DbFactory { ...@@ -44,24 +44,24 @@ class DbFactory {
// this.db.models.user.belongsTo(this.db.models.org,{constraints: false,}); // 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.org.hasMany(this.db.models.user,{constraints: false,});
this.db.models.user.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.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.app, { constraints: false, });
this.db.models.auth.belongsTo(this.db.models.company, { 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.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.user.belongsTo(this.db.models.company, { constraints: false, });
this.db.models.role.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.org.belongsTo(this.db.models.company,{constraints: false,});
this.db.models.route.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, }); // this.db.models.plugin.belongsTo(this.db.models.app, { constraints: false, });
// 商机表 1:1 方案表 // 商机表 1:1 方案表
this.db.models.scheme.belongsTo(this.db.models.bizopt, { constraints: false, }); this.db.models.scheme.belongsTo(this.db.models.bizopt, { constraints: false, });
......
const system = require("../../../system"); const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig(); const appconfig = system.getSysConfig();
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("company", { return db.define("company", {
name: { name: {
......
...@@ -5,7 +5,8 @@ const appconfig = system.getSysConfig(); ...@@ -5,7 +5,8 @@ const appconfig = system.getSysConfig();
* 公司主体表 * 公司主体表
*/ */
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("company", { //TODO:
return db.define("company1", {
name: { name: {
allowNull: false, allowNull: false,
type: DataTypes.STRING type: DataTypes.STRING
......
...@@ -6,7 +6,6 @@ class DeliverService extends ServiceBase { ...@@ -6,7 +6,6 @@ class DeliverService extends ServiceBase {
constructor() { constructor() {
super("delivery", ServiceBase.getDaoName(DeliverService)); super("delivery", ServiceBase.getDaoName(DeliverService));
this.cacheinfoDao = system.getObject("db.delivery.cacheinfoDao"); this.cacheinfoDao = system.getObject("db.delivery.cacheinfoDao");
this.companyDao = system.getObject("db.delivery.companyDao");
this.materialDao = system.getObject("db.delivery.materialDao"); this.materialDao = system.getObject("db.delivery.materialDao");
this.statuslogDao = system.getObject("db.bizchance.statuslogDao"); this.statuslogDao = system.getObject("db.bizchance.statuslogDao");
this.qualificationDao = system.getObject("db.delivery.qualificationDao"); this.qualificationDao = system.getObject("db.delivery.qualificationDao");
...@@ -34,10 +33,8 @@ class DeliverService extends ServiceBase { ...@@ -34,10 +33,8 @@ class DeliverService extends ServiceBase {
* 1.此状态下是否可以提交材料 * 1.此状态下是否可以提交材料
* 2.同步暂存数据表 * 2.同步暂存数据表
* 3.存储到材料表 * 3.存储到材料表
* 4.提取 公司主体信息 存储到公司表 * 4.更改 交付单流转状态
* 5.TODO:公司表 与 交付单 表 关联 * 5.推送到腾讯
* 6.更改 交付单流转状态
* 7.推送到腾讯
*/ */
const deliverData = await this.dao.findOne({ const deliverData = await this.dao.findOne({
id: pobj.deliver_id id: pobj.deliver_id
...@@ -64,11 +61,7 @@ class DeliverService extends ServiceBase { ...@@ -64,11 +61,7 @@ class DeliverService extends ServiceBase {
status_code: system.SERVERSESTATUS.SUBMITING status_code: system.SERVERSESTATUS.SUBMITING
}, t); }, t);
} }
await this.companyDao.createOrUpdate({
...pobj.cache_info.proposerInfo.businessLicense,
lastContactInfo: pobj.cache_info.proposerInfo.contactInfo,
firstBuyTime: deliverData.created_at
}, t);
return "SUCCESS" 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