Commit eda491c4 by 王昆

gsb

parent 1a35a12c
......@@ -8,7 +8,7 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/esign-admin/main.js"
"program": "${workspaceFolder}/esign-merchant/main.js"
}
]
}
\ No newline at end of file
#!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com"
ADD esign-admin /apps/esign-admin/
WORKDIR /apps/esign-admin/
ADD esign-merchant /apps/esign-merchant/
WORKDIR /apps/esign-merchant/
RUN cnpm install -S
CMD ["node","/apps/esign-admin/main.js"]
CMD ["node","/apps/esign-merchant/main.js"]
......
# Default ignored files
/workspace.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/xgg-saas-merchant.iml" filepath="$PROJECT_DIR$/.idea/xgg-saas-merchant.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("web.common.oplogCtl");
class MerchantUserCtl extends CtlBase {
constructor() {
super();
this.merchantSve = system.getObject("service.merchant.merchantSve");
}
async merchantOfList(params, pobj2, req) {
try {
return await this.merchantSve.merchantOfList(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async merchantOfInfo(params, pobj2, req) {
try {
return await this.merchantSve.merchantOfInfo(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async addModifyMerchants(params, pobj2, req) {
try {
return await this.merchantSve.addModifyMerchants(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async merchantSuggest(params, pobj2, req) {
try {
return await this.merchantSve.merchantSuggest(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async auditMerchant(params, pobj2, req) {
try {
params.audit_user_id = req.loginUser.id;
return await this.merchantSve.auditMerchant(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantUserCtl;
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("web.common.oplogCtl");
class MerchantaccountCtl extends CtlBase {
constructor() {
super();
this.merchantaccountSve = system.getObject("service.merchant.merchantaccountSve");
}
async reduceAccountBalance(params, pobj2, req) {
try {
return await this.merchantSve.reduceAccountBalance(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async addordelavailable(params, pobj2, req) {
try {
return await this.merchantSve.addordelavailable(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantaccountCtl;
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("web.common.oplogCtl");
class MerchantUserCtl extends CtlBase {
constructor() {
super();
this.merchanttradeSve = system.getObject("service.merchant.merchanttradeSve");
}
async merchanttradesOfList(params, pobj2, req) {
try {
return await this.merchanttradeSve.merchanttradesOfList(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
//调账添加
async addMerchanttrades(params, pobj2, req) {
try {
return await this.merchanttradeSve.addMerchanttrades(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
//充值审核
async auditMerchanttrade(params, pobj2, req) {
try {
params.audit_user_id = req.loginUser.id;
return await this.merchanttradeSve.auditMerchanttrade(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
//资金流水
async merchanttradesOfListAll(params, pobj2, req) {
try {
return await this.merchanttradeSve.merchanttradesOfListAll(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
//代客下单流水
async valetorder(params, pobj2, req) {
try {
return await this.merchanttradeSve.valetorder(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantUserCtl;
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const validation = system.getObject("util.validation");
class MerchantUserCtl extends CtlBase {
constructor() {
super();
this.userSve = system.getObject("service.uc.userSve");
}
async save(params, pobj2, req) {
try {
params.uctype_id = this.trim(params.uctype_id);
params.real_name = this.trim(params.real_name);
params.password = this.trim(params.password);
params.ucname = this.trim(params.ucname);
params.mobile = this.trim(params.mobile);
if (!params.uctype_id) {
return system.getResult(null, "请选择商户");
}
if (!params.real_name) {
return system.getResult(null, "请选择商户");
}
if (!params.ucname) {
return system.getResult(null, "请选择商户");
}
if (!params.mobile) {
return system.getResult(null, "请选择商户");
}
validation.check(params, "real_name", {name: "姓名", is_require: true});
validation.check(params, "mobile", {name: "联系电话", is_require: true});
validation.check(params, "ucname", {name: "用户名", is_require: true});
return await this.userSve.saveMerchantUser(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error.name}`);
}
}
async info(params, pobj2, req) {
try {
params.id = Number(params.id || 0);
return await this.userSve.info(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async page(params, pobj2, req) {
try {
params.utype = 2;
params.uctype_id = this.trim(params.merchant_id);
let res = await this.userSve.page(params);
if (res.status === 0 && res.data && res.data.rows) {
for (let item of res.data.rows) {
item.merchant = {id:"todo", name: "todo"};
}
}
return res;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 启用禁用
* @param {*} params
* @param {*} pobj2
* @param {*} req
*/
async enabled(params, pobj2, req) {
try {
params.id = Number(params.id || 0);
params.is_enabled = Number(params.is_enabled || 0);
return await this.userSve.enabled(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantUserCtl;
\ No newline at end of file
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
class OrderCtl extends CtlBase {
constructor() {
super();
this.userSve = system.getObject("service.uc.userSve");
this.orderSve = system.getObject("service.order.orderSve");
// this.redisClient = system.getObject("util.redisClient");
}
/**
* fn:保存订单
* 如果是单价商品 product_type=1 product_id =xxx product_ids =[] product_unit_price=1
* 如果是组合产品 product_type=2 product_id=xxx product_ids=['xxx','xxxx'] product_unit_price=-1
* ps:需要对金额单位进行转化
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async saveEorder(pobj, pobj2, req, res) {
try{
//TODO:首先拿到商户的账号信息 (拿到合同ID 合同名称 )
// TODO:需要去调用商户钱包 扣钱
if(!pobj.contract_url){
return system.getResult(null, `参数错误 业务合同不能为空`);
}
if(!pobj.live_start){
return system.getResult(null, `参数错误 生效时间不能为空`);
}
if(!pobj.live_end){
return system.getResult(null, `参数错误 结束时间不能为空`);
}
//保存
let res = await this.orderSve.saveEorder(pobj);
return system.getResult(res);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:审核订单
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async auditEorder(pobj, pobj2, req, res) {
try{
if(!pobj.id){
return system.getResult(null, `订单【${pobj.id}】不存在`);
}
if(!pobj.audit_status){
return system.getResult(null, `参数错误 审核状态不能为空`);
}
let res = await this.orderSve.auditEorder(pobj);
//TODO:审核订单成功之后
if(res.status==0){
pushMerchantTrade(pobj);
}
return system.getResult(res);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:推送商户流水
* @param params
*/
async pushMerchantTrade(params){
let orderBean = await this.orderSve.getEorderById({id: this.trim(id)});
if(!orderBean){
console.log(`推送流水失败 订单信息获取异常`);
}
if(params.audit_status=='20'){ //订单审核成功
}
if(params.audit_status=='30'){ //订单审核失败
}
}
/**
* fn:查看订单(根据ID查询)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async getEorderById(pobj, pobj2, req, res) {
try{
if(!pobj.id){
return system.getResult(null, `订单【${pobj.id}】不存在`);
}
let res = await this.orderSve.getEorderById(pobj);
return system.getResult(res);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:查看订单列表(分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async pageEorder(pobj, pobj2, req, res) {
try{
let res = await this.orderSve.pageEorder(pobj);
return system.getResult(res);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:更改订单状态
* ps:可以修改的订单的状态 支付状态 审核状态 生效状态 状态code 依次 10 20 30 待xx 完成 失败
* 每次只能修改一个状态 (这里只能修改状态没有 状态标记注释 如果修改订单审核状态为失败请调用 “auditEorder” 接口)
* TODO:可能考虑修改生效状态需要加到 延迟消息队列中 用来处理过期失效的订单
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async updEorderStatus(pobj, pobj2, req, res){
if(!pobj.id){
return system.getResult(null, `参数错误 订单ID不能为空`);
}
try{
//TODO:需要添加商户信息 (merchant_id)
return await this.orderSve.updEorderStatus(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = ProductCtl;
\ No newline at end of file
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const moment = require('moment');
class OrderCtl extends CtlBase {
constructor() {
super();
this.userSve = system.getObject("service.uc.userSve");
this.orderauthlogSve = system.getObject("service.order.orderauthlogSve");
}
/**
* fn:保存身份认证日志
* ps:测试开发中开放 ,此接口不向外暴露, 认证引擎异步回调将此次操作插入到表中
* @param pobj 1.spendedBegin消费的开始时间 2.spendedEnd消费的结束时间
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async saveEorderAuthLog(pobj, pobj2, req, res){
if(!pobj.order_id){
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if(!pobj.product_id){
return system.getResult(null, `参数错误 产品ID不能为空`);
}
if(!pobj.user_name){
return system.getResult(null, `参数错误 使用方不能为空`);
}
if(!pobj.platform_name){
return system.getResult(null, `参数错误 平台名称不能为空`);
}
if(!pobj.actual_spend_name){
return system.getResult(null, `参数错误 实际使用方不能为空`);
}
pobj.engine_trade_id = this.trim(pobj.engine_trade_id) ||'';
pobj.spended_num = Number(pobj.spended_num || 0);
pobj.spended_at = pobj.spended_at?pobj.spended_at:new Date();
pobj.pass=pobj.pass?pobj.pass:0; //是否通过 默认是不通过
try{
return await this.orderauthlogSve.saveEorderAuthLog(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:身份认证日志列表
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async pageEorderAuthLog(pobj, pobj2, req, res){
//如果存在时间筛选 时间格式 2020-05
if(pobj.spendedDate){
let dateRes = formatDate(pobj.spendedDate);
pobj.spendedBegin = dateRes.spendedBegin;
pobj.spendedEnd = dateRes.spendedEnd;
}
try{
//TODO:需要获取当前商户信息 (商户ID)
pobj.merchant_id = "xxx";
return await this.orderauthlogSve.pageEorderAuthLog(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:格式化日期
* @param params
*/
formatDate(params){
if(!params){return;}
let date = moment(params);
let spendedBegin=date.format("YYYY-MM-DD HH:mm:ss");
let tempMonth = date.month()+1;
tempMonth=tempMonth<10?'0'+tempMonth:tempMonth;
let tempDay = date.daysInMonth();
tempDay=tempDay<10?'0'+tempDay:tempDay;
let spendedEnd = date.year() + "-" + tempMonth + '-' + tempDay + " 23:59:59";
return { spendedBegin,spendedEnd };
}
}
module.exports = ProductCtl;
\ No newline at end of file
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
class OrderCtl extends CtlBase {
constructor() {
super();
this.userSve = system.getObject("service.uc.userSve");
this.orderproductSve = system.getObject("service.order.orderproductSve");
}
/**
* fn:根据产品ID查询最早创建的订单
* ps:当前商户下如果存在 单个商品和组合商品 都包涵 同样的子产品 ,在实际消费的时候 应该扣除最先创建订单的子产品(订单的状态 生效中)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async listEorderProduct(pobj, pobj2, req, res){
if(!pobj.product_id){
return system.getResult(null, `参数错误 产品ID不能为空`);
}
try{
//TODO:需要获取当前商户信息 (商户ID)
pobj.merchant_id = "xxx";
return await this.orderproductSve.listEorderProduct(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:查看当前商户下所有的订单相关的产品(没有分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|void|*>}
*/
async listEorderProductByMerchantId(pobj, pobj2, req, res){
if(!pobj.product_id){
return system.getResult(null, `参数错误 产品ID不能为空`);
}
try{
if(!pobj.merchant_id){
return system.getResult(null, `获取数据错误`);
}
return await this.orderproductSve.listEorderProductByMerchantId(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = ProductCtl;
\ No newline at end of file
var system = require("../../../system")
const settings = require("../../../../config/settings")
const CtlBase = require("../../ctlms.base");
const moment = require('moment');
class OrderCtl extends CtlBase {
constructor() {
super();
this.userSve = system.getObject("service.uc.userSve");
this.ordersignlogSve = system.getObject("service.order.ordersignlogSve");
}
/**
* fn:保存签约日志
* ps:测试开发中开放 ,此接口不向外暴露, 认证引擎异步回调将此次操作插入到表中
* @param pobj 1.spendedBegin消费的开始时间 2.spendedEnd消费的结束时间
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async saveEorderSignLog(pobj, pobj2, req, res){
if(!params.order_id){
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if(!params.product_id){
return system.getResult(null, `参数错误 产品ID不能为空`);
}
if(!params.engine_contract_name){
return system.getResult(null, `参数错误 签署任务名称不能为空`);
}
if(!params.engine_contract_id){
return system.getResult(null, `参数错误 签署ID不能为空`);
}
if(!params.actual_spend_name){
return system.getResult(null, `参数错误 实际使用方不能为空`);
}
params.spended_num = Number(params.spended_num || 0);
params.spended_at = params.spended_at?params.spended_at:new Date();
params.platform_id=params.platform_id?params.platform_id:'';
try{
return await this.ordersignlogSve.saveEorderSignLog(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:签约日志列表(分页)
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async pageEorderSignLog(pobj, pobj2, req, res){
//如果存在时间筛选 时间格式 2020-05
if(pobj.spendedDate){
let dateRes = formatDate(pobj.spendedDate);
pobj.spendedBegin = dateRes.spendedBegin;
pobj.spendedEnd = dateRes.spendedEnd;
}
try{
return await this.ordersignlogSve.pageEorderSignLog(pobj);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
/**
* fn:格式化日期
* @param params
*/
formatDate(params){
if(!params){return;}
let date = moment(params);
let spendedBegin=date.format("YYYY-MM-DD HH:mm:ss");
let tempMonth = date.month()+1;
tempMonth=tempMonth<10?'0'+tempMonth:tempMonth;
let tempDay = date.daysInMonth();
tempDay=tempDay<10?'0'+tempDay:tempDay;
let spendedEnd = date.year() + "-" + tempMonth + '-' + tempDay + " 23:59:59";
return { spendedBegin,spendedEnd };
}
}
module.exports = ProductCtl;
\ No newline at end of file
var system = require("../../../system")
const CtlBase = require("../../ctlms.base");
class ProductCtl extends CtlBase {
constructor() {
super();
this.prodSve = system.getObject("service.product.productSve");
this.redisClient = system.getObject("util.redisClient");
}
async getPage (pobj, pobj2, req) {
try {
let res = await this.prodSve.getPage(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
async getAllDic (pobj, pobj2, req) {
try {
let res = await this.prodSve.getAllDic(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
async getByIds (pobj, pobj2, req) {
try {
let res = await this.prodSve.getByIds(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
async getItems (pobj, pobj2, req) {
try {
let res = await this.prodSve.getItems(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
async createOrUpdate (pobj, pobj2, req) {
try {
let res = await this.prodSve.createOrUpdate(pobj)
return res
} catch (error) {
return system.getResultFail(500, err.message)
}
}
}
module.exports = ProductCtl;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class MerchantService extends ServiceBase {
constructor() {
super();
}
async merchantOfList(params) {
try {
return await this.callms("sve_merchant", "merchantOfList", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async merchantOfInfo(params) {
try {
return await this.callms("sve_merchant", "merchantOfInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async addModifyMerchants(params) {
try {
return await this.callms("sve_merchant", "addModifyMerchants", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async merchantSuggest(params) {
try {
return await this.callms("sve_merchant", "merchantSuggest", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async auditMerchant(params) {
try {
return await this.callms("sve_merchant", "auditMerchant", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantService;
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class MerchantaccountService extends ServiceBase {
constructor() {
super();
}
async reduceAccountBalance(params) {
try {
return await this.callms("sve_merchant", "reduceAccountBalance", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async addordelavailable(params) {
try {
return await this.callms("sve_merchant", "addordelavailable", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantaccountService;
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class MerchanttradeServcie extends ServiceBase {
constructor() {
super();
}
async merchanttradesOfList(params) {
try {
return await this.callms("sve_merchant", "merchanttradesOfList", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async addMerchanttrades(params) {
try {
return await this.callms("sve_merchant", "addMerchanttrades", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async auditMerchanttrade(params) {
try {
return await this.callms("sve_merchant", "auditMerchanttrade", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async merchanttradesOfListAll(params) {
try {
return await this.callms("sve_merchant", "merchanttradesOfListAll", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async valetorder(params) {
try {
return await this.callms("sve_merchant", "valetorder", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchanttradeServcie;
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
/**
* fn:保存订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async saveEorder(params) {
return await this.callms("sve_order", "saveEorder", params);
}
/**
* fn:审核订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async auditEorder(params) {
return await this.callms("sve_order", "auditEorder", params);
}
/**
* fn:根据ID查看订单
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async getEorderById(params) {
return await this.callms("sve_order", "getEorderById", params);
}
}
module.exports = UserService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
/**
* fn:保存身份认证日志
* @param params
* @returns {Promise<void>}
*/
async saveEorderAuthLog(params){
return await this.callms("sve_order", "saveEorderAuthLog", params);
}
/**
* fn:身份认证日志列表
* @param params
* @returns {Promise<void>}
*/
async pageEorderAuthLog(params){
return await this.callms("sve_order", "pageEorderAuthLog", params);
}
}
module.exports = UserService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
/**
* fn:根据产品ID查询最早创建的订单
* ps:当前商户下如果存在 单个商品和组合商品 都包涵 同样的子产品 ,在实际消费的时候 应该扣除最先创建订单的子产品(订单的状态 生效中)
* @param params
* @returns {Promise<void>}
*/
async listEorderProduct(params){
return await this.callms("sve_order", "listEorderProduct", params);
}
/**
* fn:fn:查看当前商户下所有的订单相关的产品(没有分页)
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async listEorderProductByMerchantId(params){
return await this.callms("sve_order", "listEorderProductByMerchantId", params);
}
}
module.exports = UserService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
/**
* fn:保存签约日志
* @param params
* @returns {Promise<void>}
*/
async saveEorderSignLog(params){
return await this.callms("sve_order", "saveEorderSignLog", params);
}
/**
* fn:签约日志列表
* @param params
* @returns {Promise<void>}
*/
async pageEorderSignLog(params){
return await this.callms("sve_order", "pageEorderSignLog", params);
}
}
module.exports = UserService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class ProductService extends ServiceBase {
constructor() {
super();
}
async getPage (params) {
try {
return await this.callms("engine_product", "getPage", params)
} catch (error) {
throw error
}
}
async getAllDic (params) {
try {
return await this.callms("engine_product", "getAllDic", params)
} catch (error) {
throw error
}
}
async getByIds (params) {
try {
return await this.callms("engine_product", "getByIds", params)
} catch (error) {
throw error
}
}
async getItems (params) {
try {
return await this.callms("engine_product", "getItems", params)
} catch (error) {
throw error
}
}
async createOrUpdate (params) {
try {
return await this.callms("engine_product", "createOrUpdate", params)
} catch (error) {
throw error
}
}
}
module.exports = ProductService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
async saveAdminUser(params) {
try {
return await this.callms("sve_uc", "saveAdminUser", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async saveMerchantUser(params) {
try {
return await this.callms("sve_uc", "saveMerchantUser", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async login(params) {
try {
return await this.callms("sve_uc", "adminLogin", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async page(params) {
try {
return await this.callms("sve_uc", "userPage", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async info(params) {
try {
return await this.callms("sve_uc", "userInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async enabled(params) {
try {
return await this.callms("sve_uc", "userEnabled", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async mapByIds(params) {
try {
return await this.callms("sve_uc", "userMapByIds", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = UserService;
\ No newline at end of file
......@@ -19,7 +19,7 @@ class UserCtl extends CtlBase {
let loginUser = await this.userSve.login({
ucname: loginName,
password: password,
uctype: 1,
uctype: 2,
});
if (loginUser.status != 0) {
return loginUser;
......
......@@ -8,8 +8,8 @@ var ENVINPUT = {
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT,
REDIS_PWD: process.env.REDIS_PWD,
DB_NAME: process.env.ESIGNADMIN_DB_NAME,
REDIS_DB: process.env.ESIGNADMIN_REDIS_DB,
DB_NAME: process.env.ESIGNMERCHANT_DB_NAME,
REDIS_DB: process.env.ESIGNMERCHANT_REDIS_DB,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev"
};
......@@ -28,7 +28,7 @@ var settings = {
salt: "%iatpD1gcxz7iF#B",
defaultpwd: "987456",
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 3601,
port: process.env.NODE_PORT || 3602,
localpath: function () {
let platform = os.platform() || "";
// windows
......
{
"name": "esign-admin",
"name": "esign-merchant",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
......
{
"name": "esign-admin",
"name": "esign-merchant",
"version": "1.0.0",
"description": "h5framework",
"main": "main.js",
......
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