Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wenHuaBu_adminServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
wenHuaBu_adminServer
Commits
af56b573
Commit
af56b573
authored
Mar 22, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
239f46a1
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
116 additions
and
69 deletions
+116
-69
examine.ts
src/biz/member/examine.ts
+1
-50
member.ts
src/biz/member/member.ts
+8
-3
order.ts
src/biz/member/order.ts
+2
-1
officialWebsite.ts
src/biz/officialWebsite.ts
+9
-3
public.ts
src/biz/public.ts
+29
-0
register.ts
src/biz/register.ts
+2
-2
router.ts
src/routers/member/router.ts
+6
-6
router.ts
src/routers/officalWebsite/router.ts
+12
-3
router.ts
src/routers/public/router.ts
+6
-0
router.ts
src/routers/router.ts
+1
-1
system.ts
src/tools/system.ts
+40
-0
No files found.
src/biz/member/examine.ts
View file @
af56b573
...
@@ -102,7 +102,7 @@ export async function adopt({id, session}) {
...
@@ -102,7 +102,7 @@ export async function adopt({id, session}) {
//todo 创建一条初始订单
//todo 创建一条初始订单
await
createOrder
(
id
,
userInfo
.
loginId
,
unitName
,
NowMs
,
MEMBERLEVEL
.
普通会员
,
userInfo
.
memberType
,
subType
,
true
);
await
createOrder
(
id
,
userInfo
.
loginId
,
u
serInfo
.
phone
,
u
nitName
,
NowMs
,
MEMBERLEVEL
.
普通会员
,
userInfo
.
memberType
,
subType
,
true
);
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
addInfo
);
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
addInfo
);
...
@@ -182,52 +182,3 @@ export async function approvalHistoryList({userId}) {
...
@@ -182,52 +182,3 @@ export async function approvalHistoryList({userId}) {
return
{
dataList
};
return
{
dataList
};
}
}
/**
* 获取下拉框选择届次
* @returns
*/
export
async
function
getSession
()
{
const
NowMs
=
new
Date
();
let
nowYear
=
parseInt
(
moment
(
NowMs
).
format
(
"YYYY"
));
let
nowMonth
=
parseInt
(
moment
(
NowMs
).
format
(
"MM"
));
let
session
=
[];
for
(
let
i
=
2008
;
i
<=
nowYear
;
i
++
)
{
session
.
push
(
getEdition
(
i
,
1
));
if
(
i
==
nowYear
)
{
if
(
nowMonth
>
6
)
session
.
push
(
getEdition
(
i
,
7
));
}
else
session
.
push
(
getEdition
(
i
,
7
));
}
return
{
session
}
}
/**
* 获取届次
* @param year 入会年份
* @param month 入会月份
* 下拉选择起始届次:2008年第四届第一次
* @returns
*/
export
function
getEdition
(
year
,
month
)
{
//起始年份和月份 第一届第一次
const
startYear
=
1993
;
let
currentYear
=
new
Date
().
getFullYear
();
if
(
year
>
currentYear
)
throw
new
BizError
(
ERRORENUM
.
无法获取未来届次
);
//计算从起始时间给定时间的总月份数
let
totalMonth
=
(
year
-
startYear
)
*
12
+
month
;
//每次是6个月
let
sessions
=
Math
.
ceil
(
totalMonth
/
6
);
//每10次一届,从第四届开始计算
let
times
=
Math
.
ceil
(
sessions
/
10
);
let
sessionNumber
=
sessions
-
(
times
-
1
)
*
10
//届次是从第四届第一次开始,所以需要减一
return
`第
${
times
}
届,第
${
sessionNumber
}
次`
;
}
src/biz/member/member.ts
View file @
af56b573
...
@@ -7,14 +7,14 @@ import { ERRORENUM } from "../../config/errorEnum";
...
@@ -7,14 +7,14 @@ import { ERRORENUM } from "../../config/errorEnum";
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
find
,
findCount
,
findOnce
,
findOnceToSort
,
findToPage
,
findToSort
}
from
"../../data/select"
;
import
{
find
,
findCount
,
findOnce
,
findOnceToSort
,
findToPage
,
findToSort
}
from
"../../data/select"
;
import
{
updateOneData
}
from
"../../data/update"
;
import
{
updateOneData
}
from
"../../data/update"
;
import
{
generateSystemId
,
successResult
}
from
"../../tools/system"
;
import
{
generateSystemId
,
getEdition
,
successResult
}
from
"../../tools/system"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
addManyData
,
addOneData
}
from
"../../data/add"
;
import
{
addManyData
,
addOneData
}
from
"../../data/add"
;
import
{
deleteManyData
,
deleteOneData
}
from
"../../data/delete"
;
import
{
deleteManyData
,
deleteOneData
}
from
"../../data/delete"
;
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
{
get
Edition
}
from
"./examine
"
;
import
{
get
CityNameByCode
}
from
"../../config/cityConfig
"
;
/**
/**
...
@@ -184,7 +184,7 @@ export async function individualMemberList({name, documentId, phone, individualM
...
@@ -184,7 +184,7 @@ export async function individualMemberList({name, documentId, phone, individualM
selectParam
.
memberType
=
MEMBERTYPE
.
个人会员
;
selectParam
.
memberType
=
MEMBERTYPE
.
个人会员
;
selectParam
.
userRegisterState
=
USERREGISTERSTATE
.
通过
;
selectParam
.
userRegisterState
=
USERREGISTERSTATE
.
通过
;
let
selectConf
=
[
"userId"
,
"memberState"
,
"
unitName
"
,
"name"
,
"sex"
,
"nation"
,
"loginId"
,
"phone"
,
"joinTime"
,
"memberLevel"
,
"sheng"
,
"shi"
,
"qu"
];
let
selectConf
=
[
"userId"
,
"memberState"
,
"
workUnit
"
,
"name"
,
"sex"
,
"nation"
,
"loginId"
,
"phone"
,
"joinTime"
,
"memberLevel"
,
"sheng"
,
"shi"
,
"qu"
];
let
dbList
=
await
findToPage
(
TABLEENUM
.
用户表
,
selectParam
,
selectConf
,
pageNumber
);
let
dbList
=
await
findToPage
(
TABLEENUM
.
用户表
,
selectParam
,
selectConf
,
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
用户表
,
selectParam
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
用户表
,
selectParam
);
...
@@ -194,6 +194,11 @@ export async function individualMemberList({name, documentId, phone, individualM
...
@@ -194,6 +194,11 @@ export async function individualMemberList({name, documentId, phone, individualM
item
.
memberState
=
changeEnumValue
(
MEMBERSTATE
,
item
.
memberState
);
item
.
memberState
=
changeEnumValue
(
MEMBERSTATE
,
item
.
memberState
);
if
(
!
item
.
memberLevel
)
item
.
memberLevel
=
"未选择"
;
if
(
!
item
.
memberLevel
)
item
.
memberLevel
=
"未选择"
;
else
item
.
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
item
.
memberLevel
);
else
item
.
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
item
.
memberLevel
);
item
.
unitName
=
info
.
workUnit
;
item
.
shi
=
getCityNameByCode
(
item
.
shi
);
item
.
sheng
=
getCityNameByCode
(
item
.
sheng
);
item
.
qu
=
getCityNameByCode
(
item
.
qu
);
dataList
.
push
(
item
);
dataList
.
push
(
item
);
});
});
...
...
src/biz/member/order.ts
View file @
af56b573
...
@@ -25,7 +25,7 @@ import { updateOneData } from "../../data/update";
...
@@ -25,7 +25,7 @@ import { updateOneData } from "../../data/update";
* @param isFirst 是否首次缴费
* @param isFirst 是否首次缴费
* @returns
* @returns
*/
*/
export
async
function
createOrder
(
id
:
string
,
loginId
:
string
,
unitName
:
string
,
orderStartMs
:
number
,
memberLv
:
number
,
memberType
:
number
,
subType
:
number
,
isFirst
:
boolean
)
{
export
async
function
createOrder
(
id
:
string
,
loginId
:
string
,
phone
:
string
,
unitName
:
string
,
orderStartMs
:
number
,
memberLv
:
number
,
memberType
:
number
,
subType
:
number
,
isFirst
:
boolean
)
{
/**计算订单周期 */
/**计算订单周期 */
const
EndMs
=
moment
(
orderStartMs
).
add
(
1
,
'years'
).
valueOf
();
const
EndMs
=
moment
(
orderStartMs
).
add
(
1
,
'years'
).
valueOf
();
/**订单id */
/**订单id */
...
@@ -63,6 +63,7 @@ export async function createOrder(id:string, loginId:string, unitName:string, or
...
@@ -63,6 +63,7 @@ export async function createOrder(id:string, loginId:string, unitName:string, or
invoiceAdd
:
''
,
invoiceAdd
:
''
,
state
:
ORDERSTATE
.
未支付
,
state
:
ORDERSTATE
.
未支付
,
isFirst
,
isFirst
,
phone
,
ct
:
new
Date
().
valueOf
()
ct
:
new
Date
().
valueOf
()
};
};
...
...
src/biz/officialWebsite.ts
View file @
af56b573
...
@@ -586,7 +586,7 @@ export async function fenHuiDongTai({agencyId, pageNumber}) {
...
@@ -586,7 +586,7 @@ export async function fenHuiDongTai({agencyId, pageNumber}) {
return
{
dataList
,
dataCount
}
return
{
dataList
,
dataCount
}
}
}
export
async
function
fenHui
DongTai
Info
({
id
})
{
export
async
function
fenHuiInfo
({
id
})
{
let
result
=
{
let
result
=
{
jiGouXinXi
:{},
jiGouXinXi
:{},
};
};
...
@@ -598,15 +598,21 @@ export async function fenHuiDongTaiInfo({id}) {
...
@@ -598,15 +598,21 @@ export async function fenHuiDongTaiInfo({id}) {
return
result
;
return
result
;
}
}
export
async
function
fenHuiDongTaiInfo
({
id
})
{
let
dongTaiInfo
=
await
findOnce
(
TABLEENUM
.
工作动态
,
{
id
,
isUse
:
true
},
[
"id"
,
"title"
,
"activityTime"
,
"imgUrl"
,
"desc"
]);
if
(
!
dongTaiInfo
||
!
dongTaiInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
dataInfo
=
extractData
(
dongTaiInfo
,
[
"title"
,
"activityTime"
,
"imgUrl"
,
"desc"
]);
return
{
dataInfo
}
}
/**
/**
* 委员名单
* 委员名单
*/
*/
export
async
function
weiYuanMingDanList
({
name
,
agencyId
,
pageNumber
})
{
export
async
function
weiYuanMingDanList
({
name
,
agencyId
,
pageNumber
,
pageSize
})
{
let
selectParam
:
any
=
{
agencyId
};
let
selectParam
:
any
=
{
agencyId
};
if
(
name
)
selectParam
.
name
=
name
;
if
(
name
)
selectParam
.
name
=
name
;
let
dataList
=
[];
let
dataList
=
[];
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
委员名单
,
selectParam
,
[
"name"
,
"branchDuties"
,
"unit"
,
"unitDuties"
],
{
branchDuties
:
1
},
pageNumber
,
20
);
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
委员名单
,
selectParam
,
[
"name"
,
"branchDuties"
,
"unit"
,
"unitDuties"
],
{
branchDuties
:
1
},
pageNumber
,
pageSize
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
委员名单
,
selectParam
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
委员名单
,
selectParam
);
dbList
.
forEach
(
info
=>
{
dbList
.
forEach
(
info
=>
{
let
addInfo
:
any
=
extractData
(
info
,
[
"name"
,
"unit"
,
"unitDuties"
]);
let
addInfo
:
any
=
extractData
(
info
,
[
"name"
,
"unit"
,
"unitDuties"
]);
...
...
src/biz/public.ts
View file @
af56b573
import
moment
=
require
(
"moment"
);
import
{
ARTICLEPOSITION
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
ARTICLEPOSITION
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
find
}
from
"../data/select"
;
import
{
find
}
from
"../data/select"
;
import
{
getEdition
}
from
"../tools/system"
;
export
function
setEnumInterface
({
defaultParam
})
{
export
function
setEnumInterface
({
defaultParam
})
{
...
@@ -60,3 +62,29 @@ export async function filePosition() {
...
@@ -60,3 +62,29 @@ export async function filePosition() {
return
{
dataList
};
return
{
dataList
};
}
}
/**
* 获取下拉框选择届次
* @returns
*/
export
async
function
getSession
()
{
const
NowMs
=
new
Date
();
let
nowYear
=
parseInt
(
moment
(
NowMs
).
format
(
"YYYY"
));
let
nowMonth
=
parseInt
(
moment
(
NowMs
).
format
(
"MM"
));
let
session
=
[];
for
(
let
i
=
2008
;
i
<=
nowYear
;
i
++
)
{
session
.
push
({
key
:
getEdition
(
i
,
1
),
value
:(
i
*
100
)
+
1
});
if
(
i
==
nowYear
&&
nowMonth
<
7
)
break
session
.
push
({
key
:
getEdition
(
i
,
7
),
value
:(
i
*
100
)
+
7
});
}
return
{
session
}
}
\ No newline at end of file
src/biz/register.ts
View file @
af56b573
...
@@ -239,11 +239,11 @@ export async function unitMemberRegister3({application, userId}) {
...
@@ -239,11 +239,11 @@ export async function unitMemberRegister3({application, userId}) {
* 前端通过该方法获取注册流程状态,流程1通过返回状态【完成第一步】,流程2通过返回状态【完成第二步】,流程3通过返回状态【完成第三步】
* 前端通过该方法获取注册流程状态,流程1通过返回状态【完成第一步】,流程2通过返回状态【完成第二步】,流程3通过返回状态【完成第三步】
*/
*/
export
async
function
registerFlowType
({
userId
})
{
export
async
function
registerFlowType
({
userId
})
{
let
oldInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
,
isAdmin
:
STATE
.
否
},
[
"userId"
,
"registerFlow"
,
"userRegisterState"
]);
let
oldInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
,
isAdmin
:
STATE
.
否
},
[
"userId"
,
"registerFlow"
,
"userRegisterState"
,
"memberType"
]);
if
(
!
oldInfo
||
!
oldInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
oldInfo
||
!
oldInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
oldInfo
.
userRegisterState
==
USERREGISTERSTATE
.
通过
)
throw
new
BizError
(
ERRORENUM
.
用户已注册成功
);
if
(
oldInfo
.
userRegisterState
==
USERREGISTERSTATE
.
通过
)
throw
new
BizError
(
ERRORENUM
.
用户已注册成功
);
let
dataInfo
:
any
=
extractData
(
oldInfo
,
[
"userId"
,
"registerFlow"
,
"userRegisterState"
]);
let
dataInfo
:
any
=
extractData
(
oldInfo
,
[
"userId"
,
"registerFlow"
,
"userRegisterState"
,
"memberType"
]);
return
{
dataInfo
};
return
{
dataInfo
};
}
}
...
...
src/routers/member/router.ts
View file @
af56b573
...
@@ -389,12 +389,12 @@ export const Config = {
...
@@ -389,12 +389,12 @@ export const Config = {
],
],
bindBiz
:
examineBiz
.
approvalHistoryList
bindBiz
:
examineBiz
.
approvalHistoryList
},
},
{
//
{
apiName
:
"下拉框选择届次"
,
//
apiName:"下拉框选择届次",
subUrl
:
'/examine/getsession'
,
//
subUrl:'/examine/getsession',
param
:[],
//
param:[],
bindBiz
:
examineBiz
.
getSession
//
bindBiz:examineBiz.getSession
}
//
}
],
],
"会费管理"
:[
"会费管理"
:[
{
{
...
...
src/routers/officalWebsite/router.ts
View file @
af56b573
...
@@ -202,15 +202,24 @@ export const Config = {
...
@@ -202,15 +202,24 @@ export const Config = {
param
:[
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"分会id"
}
{
key
:
"id"
,
type
:
"String"
,
desc
:
"分会id"
}
],
],
bindBiz
:
officialWebsiteBiz
.
fenHuiInfo
},
{
apiName
:
"分会动态详情页"
,
subUrl
:
'/fenhuidongtaiinfo'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"动态id"
}
],
bindBiz
:
officialWebsiteBiz
.
fenHuiDongTaiInfo
bindBiz
:
officialWebsiteBiz
.
fenHuiDongTaiInfo
},
},
{
{
apiName
:
"委员名单"
,
apiName
:
"委员名单"
,
subUrl
:
'/weiyuanmingdan'
,
subUrl
:
'/weiyuanmingdan'
,
param
:[
param
:[
{
key
:
"name"
,
type
:
"String"
,
desc
:
"成员名称"
},
{
key
:
"name"
,
type
:
"String"
,
desc
:
"成员名称"
,
isNull
:
true
},
{
key
:
"agencyId"
,
type
:
"Number"
,
desc
:
"分会id"
},
{
key
:
"agencyId"
,
type
:
"String"
,
desc
:
"分会id"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"分页-页数"
}
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"分页-页数"
},
{
key
:
"pageSize"
,
type
:
"Number"
,
desc
:
"页面大小"
}
],
],
bindBiz
:
officialWebsiteBiz
.
weiYuanMingDanList
bindBiz
:
officialWebsiteBiz
.
weiYuanMingDanList
}
}
...
...
src/routers/public/router.ts
View file @
af56b573
...
@@ -206,5 +206,11 @@ export const Config = {
...
@@ -206,5 +206,11 @@ export const Config = {
defaultParam
:
enumConfig
.
MEMBERSTATE
,
defaultParam
:
enumConfig
.
MEMBERSTATE
,
bindBiz
:
publicBiz
.
setEnumInterface
bindBiz
:
publicBiz
.
setEnumInterface
},
},
{
apiName
:
"下拉框选择届次"
,
subUrl
:
'/session'
,
param
:[],
bindBiz
:
publicBiz
.
getSession
}
],
],
}
}
src/routers/router.ts
View file @
af56b573
...
@@ -16,7 +16,7 @@ import * as officalWebsiteRouter from "./officalWebsite/router";
...
@@ -16,7 +16,7 @@ import * as officalWebsiteRouter from "./officalWebsite/router";
import
*
as
orderRouter
from
"./order/router"
;
import
*
as
orderRouter
from
"./order/router"
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
checkUser
,
notCheck
}
from
"../middleware/user"
;
import
{
checkUser
}
from
"../middleware/user"
;
const
Look
=
false
;
//true更新文档
const
Look
=
false
;
//true更新文档
...
...
src/tools/system.ts
View file @
af56b573
...
@@ -88,3 +88,43 @@ export function generateWXOrderId(memberType, userId) {
...
@@ -88,3 +88,43 @@ export function generateWXOrderId(memberType, userId) {
return
`
${
md5
(
`
${
memberType
}${
userId
}${
Math
.
random
()
*
100
}${
thisDate
.
valueOf
()}${
Math
.
floor
(
Math
.
random
()
*
1000
)}
`
)}
`
return
`
${
md5
(
`
${
memberType
}${
userId
}${
Math
.
random
()
*
100
}${
thisDate
.
valueOf
()}${
Math
.
floor
(
Math
.
random
()
*
1000
)}
`
)}
`
}
}
/**
* 获取届次
* @param year 入会年份
* @param month 入会月份
* 下拉选择起始届次:2008年第四届第一次
* @returns
*/
export
function
getEdition
(
year
,
month
)
{
//起始年份和月份 第一届第一次
const
startYear
=
1993
;
const
Num
=
((
year
-
startYear
)
+
1
)
/
5
;
let
jie
=
Math
.
ceil
(
Num
);
let
ci
=
((
Num
*
100
)
-
((
jie
-
1
)
*
100
))
/
10
;
if
(
month
<=
6
)
ci
=
ci
-
1
;
return
`第
${
jie
}
届,第
${
ci
}
次`
;
// const startYear = 1993;
// let jie = Math.ceil(((year-startYear)+1)/5);
// let ci = ((((year-startYear)+1)/5) - (jie - 1)) * 10;
// if (month < 6) ci = ci -1;
// let currentYear = new Date().getFullYear();
// if (year > currentYear) throw new BizError(ERRORENUM.无法获取未来届次);
// //计算从起始时间给定时间的总月份数
// let totalMonth = (year - startYear) * 12 + month;
// //每次是6个月
// let sessions = Math.ceil(totalMonth / 6);
// //每10次一届,从第四届开始计算
// let times = Math.ceil(sessions / 10);
// let sessionNumber = sessions - (times - 1) * 10 //届次是从第四届第一次开始,所以需要减一
// return `第${times}届,第${sessionNumber}次`;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment