Commit f6bbca5f by sxy

feat: 生成材料下载地址

parent 533da2e8
......@@ -266,8 +266,8 @@ class Dao {
async findById(oid) {
return this.model.findById(oid);
}
async findAll(obj) {
return this.model.findAll({ "where": obj, row: true });
async findAll(obj, include = []) {
return this.model.findAll({ "where": obj, include, row: true });
}
}
module.exports = Dao;
......@@ -17,7 +17,8 @@ class MaterialDao extends Dao {
implementationPlanInfo: pobj.cache_info.implementationPlanInfo,
safetyInfo: pobj.cache_info.safetyInfo,
otherMaterialsInfo: pobj.cache_info.otherMaterialsInfo,
deliver_id: pobj.deliver_id
deliver_id: pobj.deliver_id,
ifDownload: false
}
dataInfo.proposerInfo.businessInformation.ifListed = dataInfo.proposerInfo.businessInformation.ifListed === "true"
if (materialData) {
......
......@@ -25,6 +25,14 @@ module.exports = (db, DataTypes) => {
otherMaterialsInfo: {
allowNull: false,
type: DataTypes.JSON
},
ifDownload: {//是否生成下载文件
type: DataTypes.BOOLEAN,
defaultValue: false
},
downloadUrl: {
allowNull: true,
type: DataTypes.STRING
}
}, {
paranoid: false,//假的删除
......
......@@ -75,11 +75,14 @@ class ServiceBase {
async findById(oid) {
return this.dao.findById(oid);
}
async findAll(obj, include = []) {
return this.dao.findAll(obj, include);
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async getBusUid(prefix) {
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
......@@ -97,7 +100,7 @@ class ServiceBase {
len:返回长度
radix:参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
......
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