Commit 07078960 by lixinming

no message

parent ff88bc83
...@@ -28,4 +28,7 @@ ...@@ -28,4 +28,7 @@
<!-- 单位会员注册 --> <!-- 单位会员注册 -->
<unitMemberRegister>1729288</unitMemberRegister> <unitMemberRegister>1729288</unitMemberRegister>
</sms> </sms>
<weChart>
<notifyUrl>https://yydata.mynatapp.cc/pay/wechart/callback</notifyUrl>
</weChart>
</config> </config>
...@@ -13,6 +13,7 @@ import { ERRORENUM } from "../../config/errorEnum"; ...@@ -13,6 +13,7 @@ import { ERRORENUM } from "../../config/errorEnum";
import { generateWXOrderId, successResult } from "../../tools/system"; import { generateWXOrderId, successResult } from "../../tools/system";
import { updateOneData } from "../../data/update"; import { updateOneData } from "../../data/update";
import moment = require("moment"); import moment = require("moment");
import { systemConfig } from "../../config/serverConfig";
const AppId = 'wx96c0cf11b3babcf6'; const AppId = 'wx96c0cf11b3babcf6';
const MchId = '1614605859'; const MchId = '1614605859';
...@@ -24,7 +25,6 @@ const pay = new WxPay({ ...@@ -24,7 +25,6 @@ const pay = new WxPay({
privateKey: fs.readFileSync( path.join(__dirname.substring(0,__dirname.indexOf("out")), "keys", 'apiclient_key.pem' ) ), // 秘钥 privateKey: fs.readFileSync( path.join(__dirname.substring(0,__dirname.indexOf("out")), "keys", 'apiclient_key.pem' ) ), // 秘钥
}); });
/** /**
* native下单接口【前端调用】 * native下单接口【前端调用】
* @param param0 {id订单列表的id} * @param param0 {id订单列表的id}
...@@ -52,8 +52,9 @@ export async function placeAnOrder({id}) { ...@@ -52,8 +52,9 @@ export async function placeAnOrder({id}) {
out_trade_no,//订单号 out_trade_no,//订单号
amount:{//金额 amount:{//金额
total:orderInfo.money * 100 //微信支付的单位是分 金额要乘100 total:orderInfo.money * 100 //微信支付的单位是分 金额要乘100
// total:1
}, },
notify_url:'https://yydata.mynatapp.cc/pay/wechart/callback',//订单回调 notify_url:systemConfig.weChartNotifyUrl,//订单回调
}; };
const result = await pay.transactions_native(Param); const result = await pay.transactions_native(Param);
if (result.status != 200) throw new BizError(ERRORENUM.调起微信支付失败); if (result.status != 200) throw new BizError(ERRORENUM.调起微信支付失败);
...@@ -72,6 +73,7 @@ async function close(id:string) { ...@@ -72,6 +73,7 @@ async function close(id:string) {
return {state:WEICHARTPAYSTATE.未提交, msg:"订单已关闭"}; return {state:WEICHARTPAYSTATE.未提交, msg:"订单已关闭"};
} }
/** /**
* 订单查询状态【前端调用】 * 订单查询状态【前端调用】
*/ */
...@@ -144,7 +146,7 @@ export async function payCallback(body) { ...@@ -144,7 +146,7 @@ export async function payCallback(body) {
/**只有一笔欠费时才更新用户状态 */ /**只有一笔欠费时才更新用户状态 */
let updateUserInfo:any = {}; let updateUserInfo:any = {};
if (notPayCount < 1) { if (notPayCount <= 1) {
let newOrderInfo = await findOnceToSort(TABLEENUM.订单表, {userId:oldInfo.userId}, {lifespanEndTime:-1}, ["orderCycleStart","orderCycleEnd"]); let newOrderInfo = await findOnceToSort(TABLEENUM.订单表, {userId:oldInfo.userId}, {lifespanEndTime:-1}, ["orderCycleStart","orderCycleEnd"]);
updateUserInfo.lifespanStartTime = newOrderInfo.orderCycleStart; updateUserInfo.lifespanStartTime = newOrderInfo.orderCycleStart;
......
...@@ -65,7 +65,7 @@ export async function pendingReviewList({name, memberType, documentId, phone, ma ...@@ -65,7 +65,7 @@ export async function pendingReviewList({name, memberType, documentId, phone, ma
if (shi) selectParam.shi = shi; if (shi) selectParam.shi = shi;
const SelectFiles = ["userId", "userRegisterState", "unitName", "name", "loginId", "phone", "askForTime", "memberLevel", "sheng", "shi", "qu", "individualMemberType", "unitMemberType", "memberType", "mail"]; const SelectFiles = ["userId", "userRegisterState", "unitName", "name", "loginId", "phone", "askForTime", "memberLevel", "sheng", "shi", "qu", "individualMemberType", "unitMemberType", "memberType", "mail"];
let dbList = await findToPage(TABLEENUM.用户表, selectParam, SelectFiles, pageNumber); let dbList = await findToSortToPage(TABLEENUM.用户表, selectParam, SelectFiles, {askForTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.用户表, selectParam); let dataCount = await findCount(TABLEENUM.用户表, selectParam);
let dataList = []; let dataList = [];
......
...@@ -207,9 +207,6 @@ export async function getRenewalPeriod({name, memberType, documentId, phone, mai ...@@ -207,9 +207,6 @@ export async function getRenewalPeriod({name, memberType, documentId, phone, mai
isGracePeriod:STATE., isGracePeriod:STATE.,
lifespanEndTime:{"$lt":NowMs}, lifespanEndTime:{"$lt":NowMs},
gracePeriodEndTime:{"$lt":NowMs} gracePeriodEndTime:{"$lt":NowMs}
},
{
isFirstPay:true,
} }
], ],
userRegisterState:USERREGISTERSTATE.通过, userRegisterState:USERREGISTERSTATE.通过,
......
...@@ -16,7 +16,7 @@ export async function initConfig() { ...@@ -16,7 +16,7 @@ export async function initConfig() {
if (!configInfo || !configInfo.config) throw new BizError('xml中无配置'); if (!configInfo || !configInfo.config) throw new BizError('xml中无配置');
else { else {
let {port, mongodb, mysqldb, specifyDB } = configInfo.config; let {port, mongodb, mysqldb, specifyDB, weChart } = configInfo.config;
systemConfig.port = parseInt(port[0]); systemConfig.port = parseInt(port[0]);
const MongoPath = mongodb[0].path[0]; const MongoPath = mongodb[0].path[0];
...@@ -38,6 +38,8 @@ export async function initConfig() { ...@@ -38,6 +38,8 @@ export async function initConfig() {
} }
} }
systemConfig.weChartNotifyUrl = weChart[0].notifyUrl[0];
if (specifyDB) { if (specifyDB) {
systemConfig.specifyDB = specifyDB[0]; systemConfig.specifyDB = specifyDB[0];
} else systemConfig.specifyDB = null; } else systemConfig.specifyDB = null;
......
...@@ -20,4 +20,5 @@ export class ServerConfig { ...@@ -20,4 +20,5 @@ export class ServerConfig {
smsAppKey:string; smsAppKey:string;
smsSign:string; smsSign:string;
smsUnitMemberRegister:number; smsUnitMemberRegister:number;
weChartNotifyUrl:string;
} }
\ No newline at end of file
import { inputData } from "./biz/dataInput";
import { initAdmin } from "./biz/member/rightsMgmt"; import { initAdmin } from "./biz/member/rightsMgmt";
import { initSMS } from "./biz/sms"; import { initSMS } from "./biz/sms";
import { initSystemTask } from "./biz/task"; import { initSystemTask } from "./biz/task";
import { initConfig, systemConfig} from "./config/serverConfig"; import { initConfig, systemConfig} from "./config/serverConfig";
import { initDataBaseModel } from "./data/db/db"; import { initDataBaseModel } from "./data/db/db";
import { test1 } from "./dataScript";
import { httpServer } from "./net/http_server"; import { httpServer } from "./net/http_server";
async function lanuch() { async function lanuch() {
......
...@@ -94,7 +94,7 @@ function routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware) ...@@ -94,7 +94,7 @@ function routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware)
export async function setAdditionalRouter(httpServer) { export async function setAdditionalRouter(httpServer) {
httpServer.post('/pay/wechart/callback', asyncHandler(async (req, res) => { httpServer.post('/manage/cost/pay/wechart/callback', asyncHandler(async (req, res) => {
let result = await payCallback(req.body); let result = await payCallback(req.body);
res.success(result); res.success(result);
})); }));
......
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