Commit a31625a1 by Sxy

fix: 材料表结构变化

parent 7c536aaf
...@@ -23,6 +23,7 @@ class DeliverCtl extends CtlBase { ...@@ -23,6 +23,7 @@ class DeliverCtl extends CtlBase {
if (val.delivery_status === system.ANNUALREPORT.TAKEEFFECT) { if (val.delivery_status === system.ANNUALREPORT.TAKEEFFECT) {
val.delivery_status = val['annualreports.status'] || system.ANNUALREPORT.WAITDECLARE; val.delivery_status = val['annualreports.status'] || system.ANNUALREPORT.WAITDECLARE;
} }
val.v_action_type = val.v_action_type || "新办"
val.source_name = system.SOURCENAME[val.source_name] || val.source_name; val.source_name = system.SOURCENAME[val.source_name] || val.source_name;
val.salesman_name = val.salesman_opcode ? val.salesman_name : val.salesman_phone val.salesman_name = val.salesman_opcode ? val.salesman_name : val.salesman_phone
val.selling_price = val.selling_price / 100 val.selling_price = val.selling_price / 100
......
...@@ -115,8 +115,8 @@ class DbFactory { ...@@ -115,8 +115,8 @@ class DbFactory {
this.db.models.deliver.hasOne(this.db.models.material, { constraints: false, }); this.db.models.deliver.hasOne(this.db.models.material, { constraints: false, });
// 交付表 1:1 网文材料表 // 交付表 1:1 网文材料表
this.db.models.wangwenmaterial.belongsTo(this.db.models.deliver, { constraints: false, }); this.db.models.newmaterial.belongsTo(this.db.models.deliver, { constraints: false, });
this.db.models.deliver.hasOne(this.db.models.wangwenmaterial, { constraints: false, }); this.db.models.deliver.hasOne(this.db.models.newmaterial, { constraints: false, });
// 交付表 1:1 资质信息表 // 交付表 1:1 资质信息表
this.db.models.qualification.belongsTo(this.db.models.deliver, { constraints: false, }); this.db.models.qualification.belongsTo(this.db.models.deliver, { constraints: false, });
......
...@@ -219,7 +219,7 @@ class DeliverDao extends Dao { ...@@ -219,7 +219,7 @@ class DeliverDao extends Dao {
}, },
include: [ include: [
{ {
model: this.db.models.wangwenmaterial, model: this.db.models.newmaterial,
raw: false raw: false
} }
], ],
......
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class WangwenmaterialDao extends Dao { class NewMaterialDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(WangwenmaterialDao)); super(Dao.getModelName(NewMaterialDao));
} }
async createOrUpdate(pobj, t) { async createOrUpdate(pobj, t) {
...@@ -10,8 +10,7 @@ class WangwenmaterialDao extends Dao { ...@@ -10,8 +10,7 @@ class WangwenmaterialDao extends Dao {
}); });
let result = {}; let result = {};
let dataInfo = { let dataInfo = {
basicInfo: pobj.cache_info.basicInfo, materialInfo: pobj.cache_info,
materialList: pobj.cache_info.materialList,
deliver_id: pobj.deliver_id, deliver_id: pobj.deliver_id,
} }
if (materialData) { if (materialData) {
...@@ -29,4 +28,4 @@ class WangwenmaterialDao extends Dao { ...@@ -29,4 +28,4 @@ class WangwenmaterialDao extends Dao {
} }
} }
module.exports = WangwenmaterialDao; module.exports = NewMaterialDao;
...@@ -5,15 +5,11 @@ const appconfig = system.getSysConfig(); ...@@ -5,15 +5,11 @@ const appconfig = system.getSysConfig();
* 材料表 * 材料表
*/ */
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("wangwenmaterial", { return db.define("newmaterial", {
basicInfo: { materialInfo: {
allowNull: false, allowNull: false,
type: DataTypes.JSON type: DataTypes.JSON
}, },
materialList: {
allowNull: false,
type: DataTypes.JSON
}
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
underscored: true, underscored: true,
...@@ -21,7 +17,7 @@ module.exports = (db, DataTypes) => { ...@@ -21,7 +17,7 @@ module.exports = (db, DataTypes) => {
freezeTableName: true, freezeTableName: true,
//freezeTableName: true, //freezeTableName: true,
// define the table's name // define the table's name
tableName: 'wangwen_materials_info', tableName: 'new_materials_info',
validate: { validate: {
}, },
......
...@@ -11,7 +11,7 @@ class WangwenService extends ServiceBase { ...@@ -11,7 +11,7 @@ class WangwenService extends ServiceBase {
super("delivery", ServiceBase.getDaoName(WangwenService)); super("delivery", ServiceBase.getDaoName(WangwenService));
this.cacheinfoDao = system.getObject("db.delivery.cacheinfoDao"); this.cacheinfoDao = system.getObject("db.delivery.cacheinfoDao");
this.deliveryDao = system.getObject("db.delivery.deliverDao"); this.deliveryDao = system.getObject("db.delivery.deliverDao");
this.wangwenmaterialDao = system.getObject("db.delivery.wangwenmaterialDao"); this.newmaterialDao = system.getObject("db.delivery.newmaterialDao");
this.statuslogDao = system.getObject("db.bizchance.statuslogDao"); this.statuslogDao = system.getObject("db.bizchance.statuslogDao");
} }
...@@ -39,7 +39,7 @@ class WangwenService extends ServiceBase { ...@@ -39,7 +39,7 @@ class WangwenService extends ServiceBase {
return this.db.transaction(async (t) => { return this.db.transaction(async (t) => {
await this.cacheinfoDao.createOrUpdate(pobj, t); await this.cacheinfoDao.createOrUpdate(pobj, t);
await this.wangwenmaterialDao.createOrUpdate(pobj, t); await this.newmaterialDao.createOrUpdate(pobj, t);
if ([system.SERVERSESTATUS.COLLECTING, system.SERVERSESTATUS.USERCONFIRMATIONREJECT].includes(deliverData.delivery_status)) { if ([system.SERVERSESTATUS.COLLECTING, system.SERVERSESTATUS.USERCONFIRMATIONREJECT].includes(deliverData.delivery_status)) {
await this.deliveryDao.updateByWhere({ await this.deliveryDao.updateByWhere({
delivery_status: system.SERVERSESTATUS.USERCONFIRMATIONWAIT delivery_status: system.SERVERSESTATUS.USERCONFIRMATIONWAIT
......
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