Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_api
Project
Project
Details
Activity
Releases
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
liyilin
intel_promotion_api
Commits
6b17f7ae
Commit
6b17f7ae
authored
Jul 31, 2024
by
刘帅阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
超级管理员商家管理员展示
parent
a330d226
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
105 additions
and
1 deletion
+105
-1
CmsNewsRepository.java
...a/org/rcisoft/business/cmsnews/dao/CmsNewsRepository.java
+2
-0
CmsNewsServiceImpl.java
...oft/business/cmsnews/service/impl/CmsNewsServiceImpl.java
+13
-0
CmsVideoRepository.java
...org/rcisoft/business/cmsvideo/dao/CmsVideoRepository.java
+2
-0
CmsVideoServiceImpl.java
...t/business/cmsvideo/service/impl/CmsVideoServiceImpl.java
+12
-0
SysUnitRepository.java
...a/org/rcisoft/business/sysunit/dao/SysUnitRepository.java
+2
-0
SysUnitServiceImpl.java
...oft/business/sysunit/service/impl/SysUnitServiceImpl.java
+6
-1
CmsNewsMapper.xml
...esources/mapper/business/cmsnews/mapper/CmsNewsMapper.xml
+26
-0
CmsVideoMapper.xml
...ources/mapper/business/cmsvideo/mapper/CmsVideoMapper.xml
+25
-0
SysUnitMapper.xml
...esources/mapper/business/sysunit/mapper/SysUnitMapper.xml
+17
-0
No files found.
src/main/java/org/rcisoft/business/cmsnews/dao/CmsNewsRepository.java
View file @
6b17f7ae
...
@@ -51,5 +51,7 @@ public interface CmsNewsRepository extends CyBaseMapper<CmsNews> {
...
@@ -51,5 +51,7 @@ public interface CmsNewsRepository extends CyBaseMapper<CmsNews> {
IPage
<
CmsVideo
>
listTopVideoAdmin
(
CyPageInfo
<
CmsNews
>
paginationUtility
,
CmsVideo
cmsVideo
);
IPage
<
CmsVideo
>
listTopVideoAdmin
(
CyPageInfo
<
CmsNews
>
paginationUtility
,
CmsVideo
cmsVideo
);
IPage
<
CmsNews
>
listByClassificationAdmin
(
CyPageInfo
<
CmsNews
>
paginationUtility
,
CmsNews
cmsNews
);
IPage
<
CmsNews
>
listByClassificationAdmin
(
CyPageInfo
<
CmsNews
>
paginationUtility
,
CmsNews
cmsNews
);
IPage
<
CmsNews
>
listByClassificationMerchants
(
CyPageInfo
<
CmsNews
>
paginationUtility
,
@Param
(
"entity"
)
CmsNews
cmsNews
);
}
}
src/main/java/org/rcisoft/business/cmsnews/service/impl/CmsNewsServiceImpl.java
View file @
6b17f7ae
...
@@ -429,6 +429,19 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
...
@@ -429,6 +429,19 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
}
}
return
cmsNewsIPage
;
return
cmsNewsIPage
;
}
}
//商家管理员
if
(
CyUserUtil
.
getAuthenRoleIds
().
equals
(
cyInitComp
.
unit
[
0
]))
{
//商家管理员
IPage
<
CmsNews
>
cmsNewsIPage
=
baseMapper
.
listByClassificationMerchants
(
paginationUtility
,
cmsNews
);
List
<
CmsNews
>
records
=
cmsNewsIPage
.
getRecords
();
for
(
CmsNews
cmsNews1
:
records
)
{
if
(
cmsNews1
.
getPath
()
!=
null
)
{
cmsNews1
.
setPath
(
global
.
getBase_Discovery
()
+
cmsNews1
.
getPath
());
}
}
return
cmsNewsIPage
;
}
//校验是否包含商家信息
//校验是否包含商家信息
if
(
StringUtils
.
isEmpty
(
cmsNews
.
getUnitId
()))
{
if
(
StringUtils
.
isEmpty
(
cmsNews
.
getUnitId
()))
{
...
...
src/main/java/org/rcisoft/business/cmsvideo/dao/CmsVideoRepository.java
View file @
6b17f7ae
...
@@ -31,5 +31,7 @@ public interface CmsVideoRepository extends CyBaseMapper<CmsVideo> {
...
@@ -31,5 +31,7 @@ public interface CmsVideoRepository extends CyBaseMapper<CmsVideo> {
IPage
<
CmsVideo
>
businessAdminsPaginatedQuery
(
CyPageInfo
<
CmsVideo
>
paginationUtility
,
@Param
(
"entity"
)
CmsVideo
cmsVideo
);
IPage
<
CmsVideo
>
businessAdminsPaginatedQuery
(
CyPageInfo
<
CmsVideo
>
paginationUtility
,
@Param
(
"entity"
)
CmsVideo
cmsVideo
);
IPage
<
CmsVideo
>
listByClassificationAdmin
(
CyPageInfo
<
CmsVideo
>
paginationUtility
,
CmsVideo
cmsVideo
);
IPage
<
CmsVideo
>
listByClassificationAdmin
(
CyPageInfo
<
CmsVideo
>
paginationUtility
,
CmsVideo
cmsVideo
);
IPage
<
CmsVideo
>
listByClassificationMerchants
(
CyPageInfo
<
CmsVideo
>
paginationUtility
,
@Param
(
"entity"
)
CmsVideo
cmsVideo
);
}
}
src/main/java/org/rcisoft/business/cmsvideo/service/impl/CmsVideoServiceImpl.java
View file @
6b17f7ae
...
@@ -284,6 +284,18 @@ public class CmsVideoServiceImpl extends ServiceImpl<CmsVideoRepository, CmsVide
...
@@ -284,6 +284,18 @@ public class CmsVideoServiceImpl extends ServiceImpl<CmsVideoRepository, CmsVide
}
}
return
page
;
return
page
;
}
}
//商家管理员
if
(
CyUserUtil
.
getAuthenRoleIds
().
equals
(
cyInitComp
.
unit
[
0
]))
{
cmsVideo
.
setUserId
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()));
IPage
<
CmsVideo
>
page
=
baseMapper
.
listByClassificationMerchants
(
paginationUtility
,
cmsVideo
);
List
<
CmsVideo
>
records
=
page
.
getRecords
();
for
(
CmsVideo
cmsVideo1
:
records
)
{
if
(
cmsVideo1
.
getPath
()
!=
null
)
{
cmsVideo1
.
setPath
(
global
.
getBase_Discovery
()
+
cmsVideo1
.
getPath
());
}
}
return
page
;
}
//校验是否包含商家信息
//校验是否包含商家信息
...
...
src/main/java/org/rcisoft/business/sysunit/dao/SysUnitRepository.java
View file @
6b17f7ae
...
@@ -90,5 +90,7 @@ public interface SysUnitRepository extends CyBaseMapper<SysUnit> {
...
@@ -90,5 +90,7 @@ public interface SysUnitRepository extends CyBaseMapper<SysUnit> {
void
deleteTheUserByUserId
(
@Param
(
"entity"
)
SysUser
sysUser
);
void
deleteTheUserByUserId
(
@Param
(
"entity"
)
SysUser
sysUser
);
ArrayList
<
Integer
>
findUserId
(
Integer
unitId
);
ArrayList
<
Integer
>
findUserId
(
Integer
unitId
);
List
<
SysUnit
>
findUnit
(
String
userId
);
}
}
src/main/java/org/rcisoft/business/sysunit/service/impl/SysUnitServiceImpl.java
View file @
6b17f7ae
...
@@ -260,7 +260,12 @@ public class SysUnitServiceImpl extends ServiceImpl<SysUnitRepository, SysUnit>
...
@@ -260,7 +260,12 @@ public class SysUnitServiceImpl extends ServiceImpl<SysUnitRepository, SysUnit>
throw
new
CyServiceException
(
ResultServiceEnums
.
NOT_LOGIN
.
getCode
(),
throw
new
CyServiceException
(
ResultServiceEnums
.
NOT_LOGIN
.
getCode
(),
ResultServiceEnums
.
NOT_LOGIN
.
getMessage
());
ResultServiceEnums
.
NOT_LOGIN
.
getMessage
());
}
}
//根据用户id查询当前人的商家信息
//商家
if
(
cyInitComp
.
unit
[
0
].
equals
(
CyUserUtil
.
getAuthenRoleIds
()))
{
return
baseMapper
.
findUnit
(
userId
);
}
//根据用户id查询当前人的商家信息 (代言人)
return
baseMapper
.
findUnitByUnit
(
userId
);
return
baseMapper
.
findUnitByUnit
(
userId
);
}
}
...
...
src/main/resources/mapper/business/cmsnews/mapper/CmsNewsMapper.xml
View file @
6b17f7ae
...
@@ -447,4 +447,30 @@
...
@@ -447,4 +447,30 @@
DESC, cn.update_date DESC) cn
DESC, cn.update_date DESC) cn
GROUP BY cn.business_id
GROUP BY cn.business_id
</select>
</select>
<select
id=
"listByClassificationMerchants"
resultType=
"org.rcisoft.business.cmsnews.entity.CmsNews"
>
SELECT cn.*,
SUM(cn.click_through_rate) AS readNum
FROM (SELECT cn.*,
cpc.click_through_rate AS click_through_rate,
oi.path AS path
FROM cms_news cn
LEFT JOIN cms_unit_new_video cunv
ON cn.business_id = cunv.news_video_id AND cunv.type = 0
LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id
LEFT JOIN sys_user su ON suu.user_id = su.business_id
LEFT JOIN oss_info oi ON cn.picture_id = oi.business_id
LEFT JOIN cms_price_click cpc
ON cpc.news_video_id = cn.business_id AND cpc.del_flag = 0 AND cpc.type = 0 AND
cpc.unit_id = #{entity.unitId}
AND cpc.user_id = su.business_id
WHERE 1 = 1
AND cunv.unit_id = #{entity.unitId}
AND cn.del_flag = 0
AND cn.flag = 1
# AND cn.is_recommended = 1
GROUP BY cn.business_id, cpc.business_id
ORDER BY cn.is_top
DESC, cn.update_date DESC) cn
GROUP BY cn.business_id
</select>
</mapper>
</mapper>
src/main/resources/mapper/business/cmsvideo/mapper/CmsVideoMapper.xml
View file @
6b17f7ae
...
@@ -210,4 +210,29 @@
...
@@ -210,4 +210,29 @@
order by cv.flag DESC, cv.update_date DESC) cv
order by cv.flag DESC, cv.update_date DESC) cv
GROUP BY cv.business_id
GROUP BY cv.business_id
</select>
</select>
<select
id=
"listByClassificationMerchants"
resultType=
"org.rcisoft.business.cmsvideo.entity.CmsVideo"
>
SELECT cv.*,
SUM(cv.click_through_rate) AS readNum
FROM (SELECT cv.*,
cpc.click_through_rate AS click_through_rate,
oi1.path AS path,
oi.path AS defaultUrl
FROM cms_video cv
LEFT JOIN cms_unit_new_video cunv ON cv.business_id = cunv.news_video_id AND cunv.type = 1
LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id
LEFT JOIN sys_user su ON suu.user_id = su.business_id
AND su.del_flag = 0
AND su.flag = 1
LEFT JOIN cms_price_click cpc
ON cpc.news_video_id = cv.business_id AND cpc.del_flag = 0 AND cpc.type = 1 AND
cpc.unit_id = #{entity.unitId}
LEFT JOIN oss_info oi ON cv.video_url_id = oi.business_id
LEFT JOIN oss_info oi1 ON cv.default_url = oi1.business_id
WHERE 1 = 1
AND cunv.unit_id = #{entity.unitId}
AND cv.del_flag = 0
GROUP BY cv.business_id, cpc.business_id
order by cv.flag DESC, cv.update_date DESC) cv
GROUP BY cv.business_id
</select>
</mapper>
</mapper>
src/main/resources/mapper/business/sysunit/mapper/SysUnitMapper.xml
View file @
6b17f7ae
...
@@ -321,5 +321,22 @@
...
@@ -321,5 +321,22 @@
from sys_user_unit
from sys_user_unit
where unit_id = #{unitId}
where unit_id = #{unitId}
</select>
</select>
<select
id=
"findUnit"
resultType=
"org.rcisoft.business.sysunit.entity.SysUnit"
>
SELECT
sun.*
FROM sys_user su
LEFT JOIN sys_unit sun ON sun.business_id = su.dept_id
WHERE 1=1
<if
test=
"userId !=null and userId != '' "
>
AND su.business_id = #{userId}
</if>
AND su.del_flag = 0
AND su.flag =1
AND sun.del_flag = 0
AND sun.flag = 1
</select>
</mapper>
</mapper>
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