This commit is contained in:
2026-10-08 18:14:56 +08:00
parent dec4ebc773
commit 9cc1ff546c
1081 changed files with 238349 additions and 52163 deletions
@@ -0,0 +1,67 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/qyb/list/kh/buy 前端调用的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, contractId, contractNo, amount} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
const amountDict = await vk.baseDao.findById({
dbName: 'jjx-dict',
id: 'ded3e568662e5817000026633aad1e69'
})
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: 12,
amount,
offAmount,
saveAmount,
offRate,
}
})
await vk.baseDao.add({
dbName: "jjx-order-goods",
dataJson: {
orderId,
goodsId: contractId,
num: 1,
goodsName: `合同:${contractNo}司法调证`,
goodsPrice: amount,
goodsCover: null,
}
})
res.data = orderId
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,32 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
/**
* 添加司法调证服务申请
* @url client/contract/certificate/add 前端调用的url参数地址
* data 请求参数
*/
main: async (event) => {
let { data = {}, userInfo, util, filterResponse, originalParam } = event;
let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
let { uid } = userInfo;
let res = { code: 0, msg: "申请提交成功" };
// 业务逻辑开始-----------------------------------------------------------
// 生成交易编号
const orderNo = vk.pubfn.createOrderNo("C", 20);
// 添加司法调证服务记录
const certificateId = await vk.baseDao.add({
dbName: "jjx-certificate",
dataJson: {
userId: uid,
status: 0, // 0-待支付 1-已支付 2-处理中 3-已完成 4-已取消
...data
}
});
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,25 @@
'use strict';
const fs = require('fs');
const pdfParse = require('pdf-parse');
module.exports = {
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
const fileUrl = data.fileUrl
const keywords = data.keywords
const dataBuffer = fs.readFileSync(fileUrl);
const { text } = await pdfParse(dataBuffer);
console.log('PDF全文:', text);
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,28 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/contract/kh/report 前端调用的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 {contract_id} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
await pubFun.fadada('contractFiling.api', {
contract_id
})
const result = await pubFun.fadada('downLoadContract.api', {
contract_id
})
console.log(result)
if (parseInt(result.code) === 1000) {
res.data = result
}
return res
// 业务逻辑结束-----------------------------------------------------------
}
}
@@ -0,0 +1,39 @@
'use strict';
module.exports = {
/**
* XXXnameXXX
* @url client/contract/kh/report 前端调用的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 {contract_id} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
// const fileContent = await pubFun.fadada('downLoadContract.api', {
// contract_id
// })
// const {fileID} = await uniCloud.uploadFile({
// cloudPath: md5(contract_id) + '.pdf',
// fileContent
// })
// const {fileList} = await uniCloud.getTempFileURL({
// fileList: [fileID]
// })
// res.data = fileList[0].tempFileURL
const timestamp = vk.pubfn.timeFormat(new Date(), "yyyyMMddhhmmss");
return {
code: 0,
msg: "",
data: {
msg_digest: pubFun.getFadadaSign('downLoadContract.api', {contract_id}, timestamp),
timestamp,
app_id: 502704
}
}
// 业务逻辑结束-----------------------------------------------------------
}
}