Commit 37c25954 by wangxin

首页滚动提示

parent a7237540
......@@ -93,4 +93,11 @@ public interface PublicationManageFeignClients {
*/
@PostMapping(value = "/site/classify/publication/updateContent")
public boolean updateContent(@RequestBody PublicationVo publicationVo);
/**
* 滚动提示接口:投稿管理(4天内创建且待审核的数据)
* @return
*/
@GetMapping("/site/classify/publication/selectContributionManagementForScroll")
List<PublicationVo> selectContributionManagementForScroll();
}
......@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* com.yizhi.site.application.feign.api
*
......@@ -36,4 +38,11 @@ public interface SystemMailboxClients {
@GetMapping("/systemMailbox/hasPermission")
Boolean hasPermission();
/**
*
* @return
*/
@GetMapping("/systemMailbox/selectMailboxManagementForScroll")
List<SystemMailboxParamVo> selectMailboxManagementForScroll();
}
\ No newline at end of file
......@@ -21,6 +21,8 @@ public class SystemMailboxParamVo {
@ApiModelProperty(value = "信箱标题")
private String fileName;
@ApiModelProperty(value = "联系人")
private String contactName;
@ApiModelProperty(value = "信箱类型 1: 纪检 2: 书记")
private Integer type;
......
......@@ -82,8 +82,11 @@ public class SystemMailboxVo {
@ApiModelProperty(value = "视频链接地址")
private String ossVideoUrl;
@ApiModelProperty(value = "是否查看:0未查看,1已查看")
private Integer isViewed;
protected Serializable pkVal() {
return this.id;
}
}
}
\ No newline at end of file
......@@ -133,4 +133,13 @@ public class PublicationManageController {
}
return this.publicationService.updateById(publication);
}
/**
* 滚动提示接口:投稿管理(4天内创建且待审核的数据)
* @return
*/
@GetMapping("/selectContributionManagementForScroll")
public List<Publication> selectContributionManagementForScroll() {
return publicationService.selectContributionManagementForScroll();
}
}
......@@ -9,6 +9,8 @@ import com.yizhi.site.application.vo.domain.SystemMailboxVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* com.yizhi.site.application.controller.api
*
......@@ -51,4 +53,13 @@ public class SystemMailboxController {
public Boolean hasPermission(){
return systemMailboxService.hasPermission();
}
/**
* 滚动提示接口:信箱管理(4天内创建且未查看的数据)
* @return
*/
@GetMapping("selectMailboxManagementForScroll")
public List<SystemMailboxParamVo> selectMailboxManagementForScroll(){
return systemMailboxService.selectMailboxManagementForScroll();
}
}
\ No newline at end of file
......@@ -112,6 +112,10 @@ public class SystemMailbox {
@TableField("oss_video_url")
private String ossVideoUrl;
@ApiModelProperty(value = "是否查看:0未查看,1已查看")
@TableField("is_viewed")
private Integer isViewed;
@ApiModelProperty(value = "1:已删除,0未删除")
@TableLogic
private Integer deleted;
......@@ -119,4 +123,4 @@ public class SystemMailbox {
protected Serializable pkVal() {
return this.id;
}
}
}
\ No newline at end of file
......@@ -92,4 +92,11 @@ public interface PublicationMapper extends BaseMapper<Publication> {
List<PublicationStudentVO> publicationIndexTopList(@Param("siteId") Long siteId);
List<Publication> publicationFirstList(PublicationParamVO publicationParamVO, Page<Publication> page);
/**
* 滚动提示接口:投稿管理(4天内创建且待审核的数据)
* @param siteId
* @return
*/
List<Publication> selectContributionManagementForScroll(@Param("siteId") Long siteId);
}
\ No newline at end of file
......@@ -18,5 +18,11 @@ public interface SystemMailboxMapper extends BaseMapper<SystemMailbox> {
List<SystemMailboxParamVo> selectMyPage(@Param("accountId") Long accountId, @Param("roleType") Integer roleType, @Param("type") Integer type, @Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
int selectMyCount(@Param("accountId") Long accountId, @Param("roleType") Integer roleType, @Param("type") Integer type);
/**
* 滚动提示接口:信箱管理(4天内创建且未查看的数据)
* @param siteId
* @return
*/
List<SystemMailboxParamVo> selectMailboxManagementForScroll(@Param("accountId") Long accountId, @Param("roleType") Integer roleType);
}
......@@ -97,4 +97,9 @@ public interface PublicationService extends IService<Publication> {
Page<Publication> publicationReleaseList(PublicationParamReleaseVO vo);
/**
* 滚动提示接口:投稿管理(4天内创建且待审核的数据)
* @return
*/
List<Publication> selectContributionManagementForScroll();
}
......@@ -7,6 +7,8 @@ import com.yizhi.site.application.vo.domain.SystemMailboxParamVo;
import com.yizhi.site.application.vo.domain.SystemMailboxVo;
import com.yizhi.site.application.vo.domain.SystemMailboxConditionVo;
import java.util.List;
/**
* com.yizhi.site.application.service
*
......@@ -26,4 +28,10 @@ public interface SystemMailboxService extends IService<SystemMailbox> {
Page<SystemMailboxParamVo> selectMyPage(Integer pageNo, Integer pageSize, Integer type);
Boolean hasPermission();
/**
* 滚动提示接口:信箱管理(4天内创建且未查看的数据)
* @return
*/
List<SystemMailboxParamVo> selectMailboxManagementForScroll();
}
\ No newline at end of file
......@@ -554,4 +554,29 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
Long t = redisTemplate.getExpire(key);
return ObjectUtil.isEmpty(t) ? valueOperations.increment(key) : valueOperations.increment(key,t);
}
@Override
public List<Publication> selectContributionManagementForScroll() {
RequestContext context = ContextHolder.get();
List<Publication> list = this.baseMapper.selectContributionManagementForScroll(context.getSiteId());
if (list.size() > 0 && list != null) {
for (Publication info : list) {
if(info.getTypeOne() != null && info.getTypeOne() == 0){
info.setTypeOneName("其他");
}
if (info.getTypeOne() != null && info.getTypeOne() != 0) {
info.setTypeOneName(findNameById(info.getTypeOne()));
}
if (info.getTypeTwo() != null && info.getTypeTwo() != 0) {
info.setTypeTwoName(findNameById(info.getTypeTwo()));
}
if (info.getTypeThree() != null && info.getTypeThree() != 0) {
info.setTypeThreeName(findNameById(info.getTypeThree()));
}
}
}
return list;
}
}
......@@ -136,6 +136,13 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
if(systemMailBox==null){
return null;
}
// 更新状态为已查看
if (systemMailBox.getIsViewed() == null || systemMailBox.getIsViewed() == 0) {
systemMailBox.setIsViewed(1);
this.updateById(systemMailBox);
}
SystemMailboxVo systemMailBoxVo = new SystemMailboxVo();
BeanUtils.copyProperties(systemMailBox,systemMailBoxVo);
return systemMailBoxVo;
......@@ -183,4 +190,29 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
//
return roleType != null;
}
@Override
public List<SystemMailboxParamVo> selectMailboxManagementForScroll() {
Long accountId = ContextHolder.get().getAccountId();
List<Long> roleIds = myItemConfigmapper.getJjXxRoleCount(accountId);
Integer roleType = null;//信箱类型 1: 纪检 2: 书记,null没权限看 纪检和书记,只能看自己的
if(CollectionUtil.isNotEmpty(roleIds)){
if(roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
roleType = 2;
}
if(!roleIds.contains(1877604582759526400L)&&roleIds.contains(1877605828904022016L)){
roleType = 1;
}
}
accountId = null;
if(CollectionUtil.isNotEmpty(roleIds)){
if(!ContextHolder.get().isAdmin()&&!roleIds.contains(1877604582759526400L)&&!roleIds.contains(1877605828904022016L)){
accountId = ContextHolder.get().getAccountId();
}
}
// 调用Mapper中的新方法获取4天内创建且未查看的数据
return this.baseMapper.selectMailboxManagementForScroll(accountId, roleType);
}
}
\ No newline at end of file
......@@ -440,4 +440,12 @@
<select id="getNumberByCode" resultType="java.lang.String">
SELECT value FROM cloud_system.dictionary where code=#{code}
</select>
<!-- 滚动提示接口:投稿管理(4天内创建且待审核的数据) -->
<select id="selectContributionManagementForScroll" resultType="com.yizhi.site.application.domain.Publication">
select a.* from publication a where 1=1 and a.site_id=#{siteId}
<!-- 4天内创建的数据过滤 -->
and a.state = 2
order by a.submit_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -85,4 +85,27 @@
</if>
) a
</select>
<!-- 滚动提示接口:信箱管理(4天内创建且未查看的数据) -->
<select id="selectMailboxManagementForScroll" resultType="com.yizhi.site.application.vo.domain.SystemMailboxParamVo">
select
id,
file_name,
submit_time,
`type`,contact_name
from
system_mailbox
where
deleted = 0
and is_viewed = 0
<if test="roleType != null">
and type=#{roleType}
</if>
<if test="roleType == null and accountId!=null">
and create_by_id = #{accountId}
</if>
order by submit_time desc
</select>
</mapper>
\ No newline at end of file
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