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
c3b943fb
Commit
c3b943fb
authored
Apr 15, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
308a52bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
31 deletions
+80
-31
member.ts
src/biz/member/member.ts
+9
-4
officialWebsite.ts
src/biz/officialWebsite.ts
+28
-13
bannerGuanLi.ts
src/biz/portal/neiRongGuanLi/bannerGuanLi.ts
+35
-6
enum.ts
src/config/enum.ts
+2
-2
router.ts
src/routers/portal/router.ts
+6
-6
No files found.
src/biz/member/member.ts
View file @
c3b943fb
...
...
@@ -91,12 +91,17 @@ export async function unitMemberDetails({id}) {
let
basicInfo
:
any
=
extractData
(
oldInfo
,
UnitBasicConfig
);
/**获取订单表新社会信用代码和新发票抬头 */
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
userId
:
id
});
if
(
!
orderInfo
.
newUscc
||
!
orderInfo
.
newUnitName
)
{
if
(
orderInfo
&&
orderInfo
.
id
)
{
if
(
!
orderInfo
.
newUscc
||
!
orderInfo
.
newUnitName
)
{
basicInfo
.
newUscc
=
"-"
;
basicInfo
.
newUnitName
=
"-"
;
}
else
{
basicInfo
.
newUscc
=
orderInfo
.
newUscc
;
basicInfo
.
newUnitName
=
orderInfo
.
newUnitName
;
}
}
else
{
basicInfo
.
newUscc
=
"-"
;
basicInfo
.
newUnitName
=
"-"
;
}
else
{
basicInfo
.
newUscc
=
orderInfo
.
newUscc
;
basicInfo
.
newUnitName
=
orderInfo
.
newUnitName
;
}
let
unitInfo
=
extractData
(
oldInfo
,
UnitConfig
);
...
...
src/biz/officialWebsite.ts
View file @
c3b943fb
...
...
@@ -21,10 +21,13 @@ export async function banner() {
for
(
let
i
=
0
;
i
<
bannerData
.
length
;
i
++
)
{
let
{
imgUrl
,
articleTitle
,
desc
,
articleUrl
}
=
bannerData
[
i
];
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
let
articleTitleStr
=
''
;
if
(
articleTitle
)
{
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
}
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
:
articleUrl
||
null
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -108,10 +111,16 @@ export async function xueHuiGaiKuangBanner() {
for
(
let
i
=
0
;
i
<
bannerData
.
length
;
i
++
)
{
let
{
imgUrl
,
articleTitle
,
desc
,
articleUrl
}
=
bannerData
[
i
];
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
let
articleTitleStr
=
''
;
if
(
articleTitle
)
{
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
}
// let articleInfo = await findOnce(TABLEENUM.文章管理, {id:articleTitle}, ["id", "title"]);
// let articleTitleStr = articleInfo && articleInfo.id ? articleInfo.title : '';
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
:
articleUrl
||
null
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -270,9 +279,15 @@ export async function pinPaiXiangMuBanner() {
for
(
let
i
=
0
;
i
<
bannerData
.
length
;
i
++
)
{
let
{
imgUrl
,
articleTitle
,
desc
,
articleUrl
}
=
bannerData
[
i
];
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
let
articleTitleStr
=
''
;
if
(
articleTitle
)
{
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
}
// let articleInfo = await findOnce(TABLEENUM.文章管理, {id:articleTitle}, ["id", "title"]);
// let articleTitleStr = articleInfo && articleInfo.id ? articleInfo.title : '';
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
:
articleUrl
||
null
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -290,7 +305,7 @@ export async function pinPaiXiangMu() {
xueShuYanJiuImgList
:[]
//学术研究图片
};
/**乡村振兴 */
let
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
];
let
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
社会服务
];
let
xiangCunZhenXingData
=
await
findToSort
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
},
{
articleTime
:
-
1
}
);
xiangCunZhenXingData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
...
...
@@ -299,7 +314,7 @@ export async function pinPaiXiangMu() {
});
});
/**芳华杯 */
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
];
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
展演竞赛
];
let
fangHuaBeiData
=
await
findToSortToPage
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
},[
"id"
,
"title"
,
"imgUrl"
,
"articleTime"
,
"desc"
],
{
articleTime
:
-
1
},
1
,
10
);
fangHuaBeiData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
...
...
@@ -332,7 +347,7 @@ export async function pinPaiXiangMu() {
* 芳华杯 更多
*/
export
async
function
fangHuaBei
({
pageNumber
})
{
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
]},
display
:
STATE
.
是
};
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
展演竞赛
]},
display
:
STATE
.
是
};
let
dataBaseList
=
await
findToSortToPage
(
TABLEENUM
.
文章管理
,
findParam
,
[],
{
articleTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
...
...
@@ -376,7 +391,7 @@ export async function xueshuyanjiu({pageNumber}) {
* @returns
*/
export
async
function
xiangCunZhenXing
({
pageNumber
})
{
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
]},
display
:
STATE
.
是
};
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
社会服务
]},
display
:
STATE
.
是
};
let
dataBaseList
=
await
findToSortToPage
(
TABLEENUM
.
文章管理
,
findParam
,
[
"id"
,
"title"
,
"desc"
,
"imgUrl"
,
"articleTime"
],
{
articleTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
...
...
src/biz/portal/neiRongGuanLi/bannerGuanLi.ts
View file @
c3b943fb
...
...
@@ -14,6 +14,7 @@ import { changeArticleName, generateSystemId, successResult } from "../../../too
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
extractData
}
from
"../../../util/piecemeal"
;
import
{
changeEnumValue
}
from
"../../../util/verificationEnum"
;
import
{
wenZhangQueue
}
from
"../../task"
;
/**
...
...
@@ -24,6 +25,15 @@ import { changeEnumValue } from "../../../util/verificationEnum";
*/
export
async
function
create
(
secureArgs
)
{
let
{
userId
,
form
}
=
secureArgs
;
if
(
!
form
.
position
)
{
/**不存在内容 */
form
.
position
=
0
;
form
.
articleTitle
=
''
;
form
.
articleUrl
=
null
;
}
else
{
/**存在内容校验参数 */
if
(
!
wenZhangQueue
[
form
.
position
])
throw
new
BizError
(
ERRORENUM
.
参数错误
,
"传入类型不符合枚举"
);
}
form
.
ct
=
new
Date
().
valueOf
();
form
.
id
=
generateSystemId
(
TABLEENUM
.
banner
管理
,
userId
);
await
addOneData
(
TABLEENUM
.
banner
管理
,
form
);
...
...
@@ -39,8 +49,16 @@ export async function create(secureArgs) {
* @param updateParam
* @returns
*/
export
async
function
update
(
secureArgs
:
any
)
{
let
{
userId
,
id
,
form
}
=
secureArgs
;
export
async
function
update
({
userId
,
id
,
form
})
{
if
(
!
form
.
position
)
{
/**不存在内容 */
form
.
position
=
0
;
form
.
articleTitle
=
''
;
form
.
articleUrl
=
null
;
}
else
{
/**存在内容校验参数 */
if
(
!
wenZhangQueue
[
form
.
position
])
throw
new
BizError
(
ERRORENUM
.
参数错误
,
"传入类型不符合枚举"
);
}
let
oldInfo
=
await
findOnce
(
TABLEENUM
.
banner
管理
,
{
id
});
if
(
!
oldInfo
||
!
oldInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
...
...
@@ -71,8 +89,15 @@ export async function list(secureArgs:any) {
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
item
:
any
=
extractData
(
info
,
[
"id"
,
"location"
,
"articleTitle"
,
"position"
,
"articleUrl"
,
"display"
,
"desc"
]);
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
item
.
articleTitle
},
[
"id"
,
"title"
]);
item
.
articleTitle
=
articleInfo
.
id
?
articleInfo
.
title
:
''
;
if
(
item
.
articleTitle
)
{
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
item
.
articleTitle
},
[
"id"
,
"title"
]);
if
(
!
articleInfo
||
!
articleInfo
.
id
)
{
item
.
articleTitle
=
"无文字链接"
;
}
else
{
item
.
articleTitle
=
articleInfo
.
id
?
articleInfo
.
title
:
''
;
}
}
else
item
.
articleTitle
=
"无文字链接"
;
item
.
location
=
changeEnumValue
(
BANNERPOSITION
,
item
.
location
);
item
.
position
=
changeArticleName
([
item
.
position
]);
dataList
.
push
(
item
);
...
...
@@ -88,8 +113,12 @@ export async function list(secureArgs:any) {
export
async
function
info
(
secureArgs
:
any
)
{
let
{
id
}
=
secureArgs
;
let
oldInfo
=
await
findOnce
(
TABLEENUM
.
banner
管理
,
{
id
});
let
dataInfo
=
extractData
(
oldInfo
,
[
"id"
,
"location"
,
"articleTitle"
,
"position"
,
"imgUrl"
,
"articleUrl"
,
"desc"
]);
let
dataInfo
:
any
=
extractData
(
oldInfo
,
[
"id"
,
"location"
,
"articleTitle"
,
"position"
,
"imgUrl"
,
"articleUrl"
,
"desc"
]);
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
dataInfo
.
articleTitle
},
[
"id"
,
"title"
]);
if
(
!
articleInfo
||
!
articleInfo
.
id
)
{
dataInfo
.
articleTitle
=
null
;
dataInfo
.
articleUrl
=
null
;
}
return
{
dataInfo
};
}
...
...
src/config/enum.ts
View file @
c3b943fb
...
...
@@ -130,9 +130,9 @@ export enum ARTICLEPOSITION {
动态资讯
_hgh
学会动态
,
动态资讯
_hgh
行业风采
,
学会概况
_hgh
学会规章
,
品牌项目
_hgh
乡村振兴
,
品牌项目
_hgh
社会服务
,
品牌项目
_hgh
学术研究
,
品牌项目
_hgh
芳华杯
,
品牌项目
_hgh
展演竞赛
,
// 党建工作_hgh主题教育
}
...
...
src/routers/portal/router.ts
View file @
c3b943fb
...
...
@@ -622,10 +622,10 @@ export const Config = {
{
key
:
"form"
,
type
:
"Object"
,
sub
:
{
location
:{
type
:
'Number'
,
desc
:
'所属位置枚举'
},
position
:{
type
:
'Number'
,
desc
:
'文章位置'
},
articleTitle
:{
type
:
'String'
,
desc
:
'文章大标题'
},
position
:{
type
:
'Number'
,
desc
:
'文章位置'
,
notMustHave
:
true
},
articleTitle
:{
type
:
'String'
,
desc
:
'文章大标题'
,
notMustHave
:
true
},
imgUrl
:{
type
:
'String'
,
desc
:
'图片地址'
},
articleUrl
:{
type
:
'String'
,
desc
:
'文章链接'
},
articleUrl
:{
type
:
'String'
,
desc
:
'文章链接'
,
notMustHave
:
true
},
desc
:{
type
:
'String'
,
desc
:
'副标题'
}
},
desc
:
"表单"
...
...
@@ -640,10 +640,10 @@ export const Config = {
{
key
:
"form"
,
type
:
"Object"
,
sub
:
{
location
:{
type
:
'Number'
,
desc
:
'所属位置枚举'
},
position
:{
type
:
'Number'
,
desc
:
'文章位置'
},
articleTitle
:{
type
:
'String'
,
desc
:
'文章大标题'
},
position
:{
type
:
'Number'
,
desc
:
'文章位置'
,
notMustHave
:
true
},
articleTitle
:{
type
:
'String'
,
desc
:
'文章大标题'
,
notMustHave
:
true
},
imgUrl
:{
type
:
'String'
,
desc
:
'图片地址'
},
articleUrl
:{
type
:
'String'
,
desc
:
'文章链接'
},
articleUrl
:{
type
:
'String'
,
desc
:
'文章链接'
,
notMustHave
:
true
},
desc
:{
type
:
'String'
,
desc
:
'副标题'
}
},
desc
:
"表单"
...
...
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