|
@@ -3,10 +3,12 @@ package com.ym.mec.cms.controller;
|
|
|
import com.ym.mec.cms.dal.dao.StudentRegistrationDao;
|
|
|
import com.ym.mec.cms.dal.entity.SysConfig;
|
|
|
import com.ym.mec.cms.service.SysConfigService;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -59,7 +61,9 @@ public class NewsController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
-
|
|
|
+
|
|
|
+ private final LocalDate xiaMenBannerStartShowTime = LocalDate.parse("2021-10-01", DateUtil.dateFormatter);
|
|
|
+
|
|
|
@ApiOperation("资讯列表分页查询")
|
|
|
@GetMapping(value = "/list")
|
|
|
public Object getList(NewsInformationQueryInfo queryInfo) {
|
|
@@ -82,15 +86,23 @@ public class NewsController extends BaseController {
|
|
|
if(Objects.nonNull(cloudTeacherActiveIds)&&StringUtils.isNotBlank(cloudTeacherActiveIds.getParanValue())){
|
|
|
excludeIds = Arrays.stream(cloudTeacherActiveIds.getParanValue().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
}
|
|
|
+
|
|
|
if (user == null || user.getId() == null) {
|
|
|
queryInfo.setOrganId(43);
|
|
|
queryInfo.setExcludeIds(excludeIds);
|
|
|
} else {
|
|
|
queryInfo.setOrganId(user.getOrganId());
|
|
|
int memberGroupNum = studentRegistrationDao.countStudentMemberGroupNum(user.getId());
|
|
|
+
|
|
|
if(memberGroupNum>0){
|
|
|
queryInfo.setExcludeIds(excludeIds);
|
|
|
}
|
|
|
+
|
|
|
+ //厦门学员
|
|
|
+ boolean xiaMenNotShow = user.getOrganId()==40&&LocalDate.now().compareTo(xiaMenBannerStartShowTime)<0;
|
|
|
+ if(xiaMenNotShow){
|
|
|
+ queryInfo.setExcludeIds(null);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
@@ -140,6 +152,12 @@ public class NewsController extends BaseController {
|
|
|
if(memberGroupNum>0){
|
|
|
queryInfo.setExcludeIds(excludeIds);
|
|
|
}
|
|
|
+
|
|
|
+ //厦门学员
|
|
|
+ boolean xiaMenNotShow = user.getOrganId()==40&&LocalDate.now().compareTo(xiaMenBannerStartShowTime)<0;
|
|
|
+ if(xiaMenNotShow){
|
|
|
+ queryInfo.setExcludeIds(null);
|
|
|
+ }
|
|
|
}
|
|
|
return succeed(sysNewsInformationService.getHomeList(user, queryInfo));
|
|
|
}
|