Commit 63f4456b by lixinming

no message

parent a26cc645
...@@ -92,7 +92,10 @@ export async function unpaidList({unitName, joinStartTime, joinEndTime, memberTy ...@@ -92,7 +92,10 @@ export async function unpaidList({unitName, joinStartTime, joinEndTime, memberTy
const NowMs = new Date().valueOf(); const NowMs = new Date().valueOf();
/**到期时间距离今天小于90天 */ /**到期时间距离今天小于90天 */
let selectParam:any = { let selectParam:any = {
lifespanEndTime:{"$lt":NowMs + (90 * 24 * 3600 * 1000)}, "$and":[
{lifespanEndTime:{"$lt":NowMs + (90 * 24 * 3600 * 1000)}},
{lifespanEndTime:{"$gt":NowMs}}
],
isAdmin:STATE., isAdmin:STATE.,
isGracePeriod:STATE. isGracePeriod:STATE.
} }
......
...@@ -146,10 +146,10 @@ export async function offlinePayment({orderId, paymentNum, offlinePaymentUrl }) ...@@ -146,10 +146,10 @@ export async function offlinePayment({orderId, paymentNum, offlinePaymentUrl })
/**只有一笔欠费时才更新用户状态 */ /**只有一笔欠费时才更新用户状态 */
if (notPayCount <= 1) { if (notPayCount <= 1) {
let newOrderInfo = await findOnceToSort(TABLEENUM.订单表, {userId:orderInfo.userId}, {lifespanEndTime:-1}, ["lifespanStartTime","lifespanEndTime"]); let newOrderInfo = await findOnceToSort(TABLEENUM.订单表, {userId:orderInfo.userId}, {lifespanEndTime:-1}, ["orderCycleStart","orderCycleEnd"]);
let updateUserInfo = { let updateUserInfo = {
lifespanStartTime:newOrderInfo.lifespanStartTime, lifespanStartTime:newOrderInfo.orderCycleStart,
lifespanEndTime:newOrderInfo.lifespanEndTime, lifespanEndTime:newOrderInfo.orderCycleEnd,
isGracePeriod:STATE., isGracePeriod:STATE.,
gracePeriodEndTime:0, gracePeriodEndTime:0,
memberState:MEMBERSTATE.正常, memberState:MEMBERSTATE.正常,
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
*/ */
import moment = require("moment"); import moment = require("moment");
import { addManyData } from "./data/add"; import { addManyData, addOneData } from "./data/add";
import { TABLEENUM } from "./data/models/model"; import { TABLEENUM } from "./data/models/model";
import { generateUserId } from "./tools/system"; import { generateOrderId, generateUserId } from "./tools/system";
/** /**
* 注册账号 * 注册账号
...@@ -68,48 +68,111 @@ export async function test1() { ...@@ -68,48 +68,111 @@ export async function test1() {
export async function initOrderData() { export async function initOrderData() {
let randomNum = parseInt(`${moment().hour()}${moment().minute()}${moment().second()}${Math.ceil(Math.random() * 100)}`); let randomNum = parseInt(`${moment().hour()}${moment().minute()}${moment().second()}${Math.ceil(Math.random() * 100)}`);
let userId = generateUserId();
let userInfo = { let userInfo = {
"token" : "",
"tokenMs" : 0,
"adminLv" : [], "adminLv" : [],
"registerFlow" : 2, "registerFlow" : 2,
"isAdmin" : 0, "isAdmin" : 0,
"userRegisterState" : 1, "userRegisterState" : 4,
"memberState" : 1, "memberState" : 1,
"memberLevel" : 1, "memberLevel" : 1,
"isGracePeriod" : 0, "isGracePeriod" : 0,
"cardUrl" : [ "cardUrl" : [
"http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-873169.png" "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-873169.png"
], ],
"auxiliaryMaterial" : [], "auxiliaryMaterial" : [],
"userId" : generateUserId(), "userId" : userId,
"memberType" : 1, "memberType" : 1,
"askForTime" : 1711095028440.0, "askForTime" : 1679327000000.0,
"loginId" : `${randomNum}`, "loginId" : randomNum,
"mail" : "18120935727@163.com", "mail" : "18120935727@163.com",
"pwd" : "123456", "pwd" : "123456",
"phone" : `1812093${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}`, "phone" : `1812093${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}${Math.ceil(Math.random() * 10)}`,
"__v" : 0, "__v" : 0,
"academicCERTUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-356620.png", "academicCERTUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-356620.png",
"addres" : "才能实现但是", "addres" : "才能实现但是",
"birth" : 1711036800000.0, "birth" : 1711036800000.0,
"documentId" : "340822199901012333", "documentId" : "340822199901012333",
"documentType" : 1, "documentType" : 1,
"duties" : "吃的蔬菜生产", "duties" : "吃的蔬菜生产",
"education" : 2, "education" : 2,
"name" : `%${randomNum}`, "name" : `V${randomNum}`,
"nation" : 1, "nation" : 1,
"otherEMP" : "去年注册", "otherEMP" : "23年前注册",
"otherPROF" : "去年注册", "otherPROF" : "23年前注册",
"photoUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-624049.png", "photoUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-624049.png",
"profAchievement" : "去年注册", "profAchievement" : "23年前注册",
"profCategory" : 1, "profCategory" : 1,
"professionalCERTUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-603763.png", "professionalCERTUrl" : "http://192.168.0.105:40012/whb/files/12/vue2024-03-22_16-11-603763.png",
"qu" : "130524", "qu" : "130524",
"sex" : 2, "sex" : 2,
"sheng" : "130000", "sheng" : "130000",
"shi" : "130500", "shi" : "130500",
"studyResume" : "去年注册", "studyResume" : "23年前注册",
"unitName" : "去年注册", "unitName" : "23年前注册",
"workResume" : "去年注册", "workResume" : "23年前注册",
"workTitle" : "去年注册" "workTitle" : "23年前注册",
"auditTime" : 1679328000000.0,
"individualMemberType" : 1,
"joinTime" : 1679328000000.0,
"lifespanEndTime" : 1710864000000.0,
"lifespanStartTime" : 1679328000000.0,
"paymentStatus" : 2,
"session" : 200907
}; };
await addOneData(TABLEENUM.用户表, userInfo);
let dataList = [{
"paymentNum" : "",
"offlinePaymentUrl" : "",
"weChartPR" : "",
"weChartState" : 0,
"isFirst" : true,
"firstPayExamine" : false,
"confirmReceipt" : 0,
"invoiceStatus" : 1,
"advanceInvoice" : false,
"id" : generateOrderId(userId),
"orderCycleStart" : 1679328000000.0,
"orderCycleEnd" : 1710864000000.0,
"unitName" : "23年注册",
"money" : 100,
"paymentMethod" : 0,
"userId" : `${userId}`,
"loginId" : `${randomNum}`,
"memberCategory" : 1,
"invoiceAdd" : "",
"state" : 1,
"phone" : "181209323310",
"ct" : 1711103141897.0,
},{
"paymentNum" : "",
"offlinePaymentUrl" : "",
"weChartPR" : "",
"weChartState" : 0,
"isFirst" : false,
"firstPayExamine" : false,
"confirmReceipt" : 0,
"invoiceStatus" : 1,
"advanceInvoice" : false,
"id" : generateOrderId(userId),
"orderCycleStart" : 1710864000000.0,
"orderCycleEnd" : 1742400000000.0,
"unitName" : "23年注册",
"money" : 100,
"paymentMethod" : 0,
"userId" : `${userId}`,
"loginId" : `${randomNum}`,
"memberCategory" : 1,
"invoiceAdd" : "",
"state" : 1,
"phone" : "181209323310",
"ct" : 1711103141897.0,
}];
await addManyData(TABLEENUM.订单表, dataList);
console.log("订单数据模拟成功");
} }
\ No newline at end of file
import { initAdmin } from "./biz/member/rightsMgmt"; import { initAdmin } from "./biz/member/rightsMgmt";
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 { test1, initOrderData } from "./dataScript";
import { httpServer } from "./net/http_server"; import { httpServer } from "./net/http_server";
async function lanuch() { async function lanuch() {
...@@ -16,6 +16,7 @@ async function lanuch() { ...@@ -16,6 +16,7 @@ async function lanuch() {
console.log('This indicates that the server is started successfully.'); console.log('This indicates that the server is started successfully.');
// await initAdmin(); // await initAdmin();
// test1(); // test1();
// await initOrderData()
} }
lanuch(); lanuch();
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