Commit d810a665 by 梁梦欢

hh

parent 42131a0c
...@@ -10,21 +10,16 @@ class AppDao extends Dao { ...@@ -10,21 +10,16 @@ class AppDao extends Dao {
uappKey: appKey uappKey: appKey
}, },
attributes: ["id", attributes: ["id",
"name", // 应用名称 "app_code", //渠道码
"appDataOpType", // 应用数据操作类型:00独立,10全委托,20部分委托 "app_name",
"appPayType", // 支付类型:00第三方应用自己支付,10平台代收款 "uapp_id", //平台appid
"contactName", // 联系人姓名 "uapp_key", //平台appkey,用于进行签名请求接口
"contactMobile", // 联系人手机 "uapp_secret",//平台appkey密钥信息
"contactEmail", // 联系人邮箱 "contact_name", //联系人
"uappKey", // 平台应用key "contact_mobile", //联系电话
"appSecret", // 密钥信息,用于进行签名请求接口 "contact_email", //联系人邮箱
"status", // 状态 0禁用 1启用 "is_enabled" //状态 0禁用 1启用
"uAppId", ],
"channelAppId", // 渠道appID
"channelAppKey", // 渠道appKey
"pushOrderUrl", //获取渠道推送订单的url
"appSourceCode", //app来源code
"notes"],
raw: true raw: true
}); });
} }
......
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class MoneyAccountDao extends Dao { class AppPayparamDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(MoneyAccountDao)); super(Dao.getModelName(AppPayparamDao));
} }
} }
module.exports = MoneyAccountDao; module.exports = AppPayparamDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class AppProductDao extends Dao {
constructor() {
super(Dao.getModelName(AppProductDao));
}
async findOneByServiceItemCode(itemCode, appId) {
return this.model.findOne({
where: {
serviceItemCode: itemCode,
app_id: appId
},
attributes: ["id",
"app_id", // 应用id
"itemCode", // 产品编码
"itemName", // 产品名称
"picUrl", // 产品图片地址
"channelItemCode", // 渠道产品编码
"channelItemName", // 渠道产品名称
"serviceItemCode",
"pushServiceItemCode",
"status", // 状态 0禁用 1启用
"verifyPrice", // 是否验证价格 0不验证 1验证
"proPrice", // 产品价格
"serviceCharge", // 服务费
"publicExpense", // 官费
"rateConfig", // 税率
"discountsRateConfig",// 优惠税率
"channelProfitRate",// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort",
"productType_id",
"productOneType_id"],
raw: true
});
}
async findOneByCode(itemCode, appId) {
return this.model.findOne({
where: {
itemCode: itemCode,
app_id: appId
},
attributes: ["id",
"app_id", // 应用id
"itemCode", // 产品编码
"itemName", // 产品名称
"picUrl", // 产品图片地址
"channelItemCode", // 渠道产品编码
"channelItemName", // 渠道产品名称
"serviceItemCode",
"pushServiceItemCode",
"status", // 状态 0禁用 1启用
"verifyPrice", // 是否验证价格 0不验证 1验证
"proPrice", // 产品价格
"serviceCharge", // 服务费
"publicExpense", // 官费
"rateConfig", // 税率
"discountsRateConfig",// 优惠税率
"channelProfitRate",// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort",
"productType_id",
"productOneType_id"],
raw: true
});
}
async findOneByChannelItemCode(channelItemCode, appId) {
return this.model.findOne({
where: {
channelItemCode: channelItemCode,
app_id: appId
},
attributes: ["id",
"app_id", // 应用id
"itemCode", // 产品编码
"itemName", // 产品名称
"picUrl", // 产品图片地址
"channelItemCode", // 渠道产品编码
"channelItemName", // 渠道产品名称
"serviceItemCode",
"pushServiceItemCode",
"deliveryUrl",
"status", // 状态 0禁用 1启用
"verifyPrice", // 是否验证价格 0不验证 1验证
"proPrice", // 产品价格
"serviceCharge", // 服务费
"publicExpense", // 官费
"rateConfig", // 税率
"discountsRateConfig",// 优惠税率
"channelProfitRate",// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort",
"productType_id",
"productOneType_id"],
raw: true
});
}
}
module.exports = AppProductDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class AppUserDao extends Dao {
constructor() {
super(Dao.getModelName(AppUserDao));
}
async getItemByUUserId(uUserName, appId) {
return this.model.findOne({
where: {
uUserName: uUserName,
app_id: appId
},
attributes: ["id",
"app_id",
"channelUserId",
"channelUserName",
"uUserName",
"uAppId",
"userMoblie",
"nickname",
"orgName",
"orgPath",
"isEnabled",
"loginNum",
"lastLoginTime"],
raw: true
});
}
}
module.exports = AppUserDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class RoleDao extends Dao {
constructor() {
super(Dao.getModelName(RoleDao));
}
}
module.exports = RoleDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class UserDao extends Dao {
constructor() {
super(Dao.getModelName(UserDao));
}
}
module.exports = UserDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ProductDao extends Dao {
constructor() {
super(Dao.getModelName(ProductDao));
}
}
module.exports = ProductDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ProductInterfaceDao extends Dao {
constructor() {
super(Dao.getModelName(ProductInterfaceDao));
}
}
module.exports = ProductInterfaceDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ProductPriceDao extends Dao {
constructor() {
super(Dao.getModelName(ProductPriceDao));
}
}
module.exports = ProductPriceDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ProductTypeDao extends Dao {
constructor() {
super(Dao.getModelName(ProductTypeDao));
}
}
module.exports = ProductTypeDao;
...@@ -20,6 +20,12 @@ module.exports = { ...@@ -20,6 +20,12 @@ module.exports = {
}, },
"pdict": { "pdict": {
"price_type": { "mj": "每件", "mc": "每次" ,"mt":"每天","my":"每月","mn":"每年","qj":"区间"},
"req_type": { "bd": "本地", "yc": "远程" },
"interface_type": { "sjts": "商机推送", "ddcz": "订单操作" },
//---------
"logLevel": { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 }, "logLevel": { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 },
//应用数据操作类型 //应用数据操作类型
"app_data_op_type": { "00": "独立", "10": "全委托", "20": "部分委托" }, "app_data_op_type": { "00": "独立", "10": "全委托", "20": "部分委托" },
......
...@@ -3,27 +3,18 @@ const settings = require("../../../../config/settings"); ...@@ -3,27 +3,18 @@ const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey); const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("app", { return db.define("app", {
name: DataTypes.STRING(100), // 应用名称 app_code: DataTypes.STRING(64), //渠道码
appDataOpType: { app_name: DataTypes.STRING(100),
type: DataTypes.ENUM, uapp_id: DataTypes.STRING(64), //平台appid
values: Object.keys(uiconfig.config.pdict.app_data_op_type), uapp_key: DataTypes.STRING(64), //平台appkey,用于进行签名请求接口
}, // 应用数据操作类型:00独立,10全委托,20部分委托 uapp_secret: DataTypes.STRING(64), //平台appkey密钥信息
appPayType: { contact_name: DataTypes.STRING(50), //联系人
type: DataTypes.ENUM, contact_mobile: DataTypes.STRING(50), //联系电话
values: Object.keys(uiconfig.config.pdict.app_pay_type), contact_email: DataTypes.STRING(50), //联系人邮箱
}, // 支付类型:00第三方支付,10平台代收款 is_enabled: { //状态 0禁用 1启用
contactName : DataTypes.STRING(30), // 联系人姓名 type: DataTypes.BOOLEAN,
contactMobile: DataTypes.STRING(30), // 联系人手机 defaultValue: true,
contactEmail : DataTypes.STRING(30), // 联系人邮箱 },
uappKey : DataTypes.STRING(64), // 平台应用key
uAppId : DataTypes.INTEGER, //
appSecret : DataTypes.STRING(64), // 密钥信息,用于进行签名请求接口
status : DataTypes.INTEGER, // 状态 0禁用 1启用
channelAppId : DataTypes.STRING(64), // 渠道appID
channelAppKey: DataTypes.STRING(64), // 渠道appKey
pushOrderUrl : DataTypes.STRING(500), // 获取渠道推送订单的url
appSourceCode : DataTypes.STRING(50), // app来源code
notes : DataTypes.STRING, // 备注
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
underscored: true, underscored: true,
...@@ -31,42 +22,12 @@ module.exports = (db, DataTypes) => { ...@@ -31,42 +22,12 @@ module.exports = (db, DataTypes) => {
freezeTableName: true, freezeTableName: true,
timestamps: true, timestamps: true,
updatedAt: false, updatedAt: false,
//freezeTableName: true, tableName: 'p_app',
// define the table's name
tableName: 'c_app',
validate: { validate: {
}, },
indexes: [ 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}]
// }
] ]
}); });
} }
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("apppayparam", {
uapp_id: DataTypes.STRING(50),
mch_id: DataTypes.STRING(50), //支付商户id
pay_key: DataTypes.STRING(50),
is_enabled: { //状态 0禁用 1启用
type: DataTypes.BOOLEAN,
defaultValue: true,
},
pay_url: DataTypes.STRING(255), //支付地址
notifyUrl: DataTypes.STRING(500), //支付成功后通知的地址
notes: DataTypes.STRING(255),
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_app_payparam',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("appproduct", {
app_id :DataTypes.STRING(50),// 应用id
itemCode :DataTypes.STRING(100),// 产品编码
itemName :DataTypes.STRING(100),// 产品名称
picUrl :DataTypes.STRING(500),// 产品图片地址
channelItemCode :DataTypes.STRING(100),// 渠道产品编码
channelItemName :DataTypes.STRING(100),// 渠道产品名称
serviceItemCode :DataTypes.STRING(100),// 服务商产品编码
pushServiceItemCode :DataTypes.STRING(100),// 推送到服务商的产品编码
status :DataTypes.BOOLEAN,// 状态 0禁用 1启用
verifyPrice :DataTypes.BOOLEAN,// 是否验证价格 0不验证 1验证
proPrice :DataTypes.DOUBLE,// 产品价格
serviceCharge :DataTypes.DOUBLE,// 服务费
publicExpense :DataTypes.DOUBLE,// 官费
rateConfig :DataTypes.DECIMAL(12, 2),// 税率
discountsRateConfig :DataTypes.DECIMAL(12, 2),// 优惠税率
channelProfitRate :DataTypes.DECIMAL(12, 2),// 渠道利润分成比率(只分订单中毛利润总额的分成)
sort :DataTypes.INTEGER,// 排序
productType_id :DataTypes.INTEGER,// 产品类型Id
productOneType_id :DataTypes.INTEGER,// 产品大类Id
deliveryUrl:DataTypes.STRING(500),// 交付地址
productLogo:DataTypes.STRING(500),// 产品logo
productDesc:DataTypes.STRING(1024),// 产品描述
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_app_product',
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}]
// }
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("moneyaccount", {
app_id: DataTypes.INTEGER, // 是否显示
balance: {//余额
type: DataTypes.DECIMAL(12, 3),
defaultValue: 0.00,
},
accountType: {
//帐户类型:"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.pay_account_type),
set: function (val) {
this.setDataValue("accountType", val);
this.setDataValue("accountTypeName", uiconfig.config.pdict.pay_account_type[val]);
},
defaultValue: "other",
},
accountTypeName: {//帐户类型名称
type: DataTypes.STRING(50),
defaultValue: "其它",
},
payeeName: {
type: DataTypes.STRING(100),
},//收款人姓名
certificateNo: DataTypes.STRING(100),//帐号
bankAddr: DataTypes.STRING(500), //银行地址
description: DataTypes.STRING,//描述
isOfflinePay: {//是否支持线下支付,0否,1是
type: DataTypes.BOOLEAN,
defaultValue: false,
},
transferRate: {//商户收款费率,千分率,如:值为5,计算时除以1000(第三方公司收款账户有此值)
type: DataTypes.DECIMAL(12, 2),
defaultValue: 5.00,
},
bankToPtTransferRate: {//银行收平台费率,千分率,如:值为2.6,计算时除以1000(平台公司收款账户有此值)
type: DataTypes.DECIMAL(12, 2),
defaultValue: 0,
},
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'b_moneyaccount',
validate: {
},
indexes: [
]
});
}
\ No newline at end of file
...@@ -2,19 +2,11 @@ const system = require("../../../system"); ...@@ -2,19 +2,11 @@ const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey); const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("appuser", { return db.define("role", {
app_id : DataTypes.INTEGER, // 应用id uapp_id: DataTypes.INTEGER,
channelUserId : DataTypes.STRING(64), // 渠道用户ID r_name: DataTypes.STRING(255), //角色名称
channelUserName : DataTypes.STRING(64), // 渠道用户登录名 r_code: DataTypes.STRING(255), //角色编码
uUserName : DataTypes.STRING(64), // description: DataTypes.STRING(255), //描述
uAppId : DataTypes.INTEGER, //
userMoblie : DataTypes.STRING(20), // 用户手机号
nickname : DataTypes.STRING(50), // 昵称
orgName : DataTypes.STRING(255), // 组织结构名称
orgPath : DataTypes.STRING(255), // 组织结构路径
isEnabled : DataTypes.INTEGER, // 是否启用
loginNum : DataTypes.INTEGER, // 登录次数
lastLoginTime : DataTypes.DATE, // 上次登录时间
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
underscored: true, underscored: true,
...@@ -24,7 +16,7 @@ module.exports = (db, DataTypes) => { ...@@ -24,7 +16,7 @@ module.exports = (db, DataTypes) => {
updatedAt: false, updatedAt: false,
//freezeTableName: true, //freezeTableName: true,
// define the table's name // define the table's name
tableName: 'c_app_user', tableName: 'p_role',
validate: { validate: {
}, },
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("user", {
uapp_id: DataTypes.INTEGER,
channel_userid: DataTypes.STRING(64), //渠道用户ID
channel_username: DataTypes.STRING(64), //渠道用户登录名
channel_nickname: DataTypes.STRING(255),
open_id: DataTypes.STRING(64), //用户唯一ID(可用与微信唯一ID)
head_url: DataTypes.STRING(255),
mobile: DataTypes.STRING(255),
email: DataTypes.STRING(50),
is_admin: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
is_super: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
is_enabled: {
type: DataTypes.BOOLEAN,
defaultValue: true,
},
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'p_user',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("product", {
uapp_id: DataTypes.INTEGER, //应用id
path_code: DataTypes.STRING(512), //产品类型编码路径,如:1/2
path_name: DataTypes.STRING(512), //产品类型名称路径,如:商标服务/商标注册
item_code: DataTypes.STRING(100), //产品编码
item_name: DataTypes.STRING(100), //产品名称
pic_url: DataTypes.STRING(500), //产品图片地址
product_desc: DataTypes.STRING(1024), //简介
channel_item_code: DataTypes.STRING(100), //渠道产品编码
channel_item_name: DataTypes.STRING(100), //渠道产品名称
is_enabled: { //状态 0禁用 1启用
type: DataTypes.BOOLEAN,
defaultValue: true,
},
sort: DataTypes.INTEGER, //排序
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_product',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("productinterface", {
product_id: DataTypes.INTEGER,
interface_url: DataTypes.STRING(255), //推送到服务商的产品编码
req_type: { //请求类型,bd本地,yc远程
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.req_type),
set: function (val) {
this.setDataValue("req_type", val);
this.setDataValue("req_type_name", uiconfig.config.pdict.req_type[val]);
},
},
req_type_name: DataTypes.STRING(255),
interface_type: { //接口类型sjts商机推送,ddcz订单操作
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.interface_type),
set: function (val) {
this.setDataValue("interface_type", val);
this.setDataValue("interface_type_name", uiconfig.config.pdict.interface_type[val]);
},
},
interface_type_name: DataTypes.STRING(255),
params: DataTypes.STRING(1024), //参数
desc: DataTypes.STRING(1024), //描述
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_product_interface',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("productprice", {
product_id: DataTypes.INTEGER, //产品id
price:DataTypes.DOUBLE, //产品价格
supply_price:DataTypes.DOUBLE, //供货价格
service_charge:DataTypes.DOUBLE, //服务费
public_expense:DataTypes.DOUBLE, //官费
channel_profit_rate: DataTypes.INTEGER, //渠道利润分成比例(百分比,主要分:产品价格-供货价格)
is_default: {//是否默认
type: DataTypes.BOOLEAN,
defaultValue: false,
},
price_type: { //类型mj:每件,mc:每次,mt:每天,my:每月,mn:每年,qj:区间
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.price_type),
set: function (val) {
this.setDataValue("price_type", val);
this.setDataValue("price_type_name", uiconfig.config.pdict.price_type[val]);
},
},
price_type_name: DataTypes.STRING(10), //定价类型名称
sort: DataTypes.INTEGER,
price_desc: DataTypes.STRING(255), //价格描述
min_qty: DataTypes.INTEGER, //最小数量
max_qty: DataTypes.INTEGER, //最大数量
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_product_price',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("producttype", {
p_id: DataTypes.INTEGER, //父id
type_code: DataTypes.STRING(64),
type_name: DataTypes.STRING(64),
type_pic: DataTypes.STRING(512),
type_desc: DataTypes.STRING(1024), //描述
type_icon: DataTypes.STRING(512),
is_enabled: { //状态 0禁用 1启用
type: DataTypes.BOOLEAN,
defaultValue: true,
},
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_product_type',
validate: {
},
indexes: [
]
});
}
...@@ -2,12 +2,12 @@ const system = require("../../../system"); ...@@ -2,12 +2,12 @@ const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
class AapService extends ServiceBase { class AppService extends ServiceBase {
constructor() { constructor() {
super("dbapp", ServiceBase.getDaoName(AapService)); super("dbapp", ServiceBase.getDaoName(AppService));
} }
async getItemByAppKey(appKey) { async getItemByAppKey(appKey) {
return this.dao.getItemByAppKey(appKey); return this.dao.getItemByAppKey(appKey);
} }
} }
module.exports = AapService; module.exports = AppService;
...@@ -2,9 +2,10 @@ const system = require("../../../system"); ...@@ -2,9 +2,10 @@ const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
class MoneyAccountService extends ServiceBase { class AppPayparamService extends ServiceBase {
constructor() { constructor() {
super("dbapp", ServiceBase.getDaoName(MoneyAccountService)); super("dbapp", ServiceBase.getDaoName(AppPayparamService));
} }
} }
module.exports=MoneyAccountService; module.exports = AppPayparamService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class AppProductService extends ServiceBase {
constructor() {
super("dbapp", ServiceBase.getDaoName(AppProductService));
}
//根据渠道产品码获取产品详情
async findByChannelItemCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var channelItemCode = obj.channelItemCode;
if(!channelItemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var product = await this.dao.model.findOne({
where:{channelItemCode:channelItemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig"],
raw:true
});
if(!product){
return system.getResultFail(-104, "未知产品");
}
return system.getResultSuccess(product);
}
//获取产品列表(根据父类产品编码获取)
async findByProductTypeCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var itemCode = obj.itemCode;
if(!itemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var pProduct = await this.dao.model.findOne({
where:{itemCode:itemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName"],
raw:true
});
if(!pProduct || !pProduct.id){
return system.getResultFail(-104, "未知产品");
}
var pList = await this.dao.model.findAll({
where:{productType_id:pProduct.id,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig",
"productLogo","productDesc"
],
raw:true
});
return system.getResultSuccess(pList);
}
//获取产品列表(根据产品一类编码获取)
async findByProductOneTypeCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var itemCode = obj.itemCode;
if(!itemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var pProduct = await this.dao.model.findOne({
where:{itemCode:itemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName"],
raw:true
});
if(!pProduct || !pProduct.id){
return system.getResultFail(-104, "未知产品");
}
var pList = await this.dao.model.findAll({
where:{productOneType_id:pProduct.id,productType_id:{ [this.db.Op.ne]: 0 },app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig",
"productLogo","productDesc"
],
raw:true
});
return system.getResultSuccess(pList);
}
}
module.exports = AppProductService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class AapUserService extends ServiceBase {
constructor() {
super("dbapp", ServiceBase.getDaoName(AapUserService));
this.opPlatformUtils = system.getObject("util.businessManager.opPlatformUtils");
}
async loginUser(channelUserId, channelUserName, userMoblie, nickname, orgName, orgPath) {
if (!channelUserId) {
return system.getResult(null, "channelUserId不能为空");
}
var params = {
channelUserId: channelUserId,
channelUserName: channelUserName,
userMoblie: userMoblie,
nickname: nickname,
orgName: orgName,
orgPath: orgPath
}
var userItem = await this.cacheManager["ApiUserCache"].cache(channelUserId, { status: true }, 3000, params);
if (!userItem) {
return system.getResult(null, "用户注册失败");
}
return system.getResultSuccess(userItem);
}
}
module.exports = AapUserService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class RoleService extends ServiceBase {
constructor() {
super("dbapp", ServiceBase.getDaoName(RoleService));
}
}
module.exports=RoleService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class UserService extends ServiceBase {
constructor() {
super("dbapp", ServiceBase.getDaoName(UserService));
}
}
module.exports = UserService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class ProductService extends ServiceBase {
constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductService));
}
}
module.exports = ProductService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class ProductInterfaceService extends ServiceBase {
constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductInterfaceService));
}
}
module.exports = ProductInterfaceService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class ProductPriceService extends ServiceBase {
constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductPriceService));
}
}
module.exports = ProductPriceService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class ProductTypeService extends ServiceBase {
constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductTypeService));
}
}
module.exports = ProductTypeService;
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