Commit a31625a1 by Sxy

fix: 材料表结构变化

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