feat: 补齐客户端/管理端服务模块与数据库 schema,完善登录短信、法大大签署及公共函数

This commit is contained in:
2026-10-14 21:55:08 +08:00
parent 3481fda7a0
commit 55bcf96889
545 changed files with 28151 additions and 415 deletions
@@ -0,0 +1,70 @@
'use strict';
module.exports = {
/**
* 新增报价
* @url client/enquiry/quote/kh/addQuote 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid, totalPrice} = data;
let {company, manager, person, accountType} = userInfo
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
const amountItem = await vk.baseDao.findById({
dbName: 'jjx-dict',
id: '6587dd54189f86d49b3d5ff5'
})
const amount = amountItem.content
let offAmount = amount
let saveAmount = 0, offRate = 100
if (userInfo.userLevel > 0) {
const userLevel = await vk.baseDao.findByWhereJson({
dbName: "jjx-user-level",
whereJson: {
level: userInfo.userLevel
}
})
if (userLevel) {
offRate = parseInt(userLevel.valueAddRate)
offAmount = (amount * (parseInt(userLevel.valueAddRate) / 100)).toFixed(2)
saveAmount = (amount - offAmount).toFixed(2)
}
}
const orderId = await vk.baseDao.add({
dbName: "jjx-order",
dataJson: {
orderNo: vk.pubfn.createOrderNo("39XU", 20),
uid,
orderStatus: 0,
type: 10,
amount,
offAmount,
saveAmount,
offRate,
}
})
await vk.baseDao.add({
dbName: "jjx-order-goods",
dataJson: {
orderId,
goodsId: null,
num: 1,
goodsName: '旧货发布次数购买',
goodsPrice: amount,
goodsCover: null,
}
})
res.data = orderId
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}