Commit 87016ae9 authored by luzhuang's avatar luzhuang

fix: 修改label添加newcount逻辑

parent d2b46243
......@@ -83,7 +83,7 @@ public class BLabelController extends PaginationController<BLabel> {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLabelService.queryBlabels(lName,curUser.getCorpId()));
bLabelService.queryBlabels(lName,curUser));
}
}
......@@ -11,7 +11,7 @@ public interface BLabelService {
List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName,String corpId);
List<BLabel> queryBlabels(String lName,String corpId);
List<BLabel> queryBlabels(String lName,CurUser curUser);
PersistModel insertLabel(BLabel bLabel, CurUser curUser);
......
......@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@Service
......@@ -37,19 +38,24 @@ public class BLabelServiceImpl implements BLabelService {
}
@Override
public List<BLabel> queryBlabels(String lName, String corpId) {
CurUser curUser = UserUtil.getCurUser();
List<BLabel> labels = bLabelRepository.queryBlabels(lName, corpId);
public List<BLabel> queryBlabels(String lName, CurUser curUser) {
List<BLabel> labels = bLabelRepository.queryBlabels(lName, curUser.getCorpId());
List<BLesson> lessons = bLessonService.queryHomeBLessons(curUser);
log.info("-----------addNewLable----------首页所有课程总个数--"+lessons.size()+"--------------------");
//筛选 new lesson
List<BLesson> newLessons = new ArrayList<>();
for(BLesson b : lessons){
if("1".equals(b.getIsNew()))
newLessons.add(b);
}
for (BLabel label : labels) {
int num = 0;
for (BLesson lesson : lessons) {
for (BLesson lesson : newLessons) {
List<QueryLabelResDTO> labelResDTOS = lesson.getLabelList();
if (labelResDTOS.size() > 0) {
for (QueryLabelResDTO dto : labelResDTOS) {
if (dto.getBusinessId() == label.getBusinessId())
if (dto.getBusinessId().equals(label.getBusinessId()))
num++;
}
}
......
......@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.service.BCourseService;
import org.rcisoft.business.blabel.service.BLabelService;
import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.entity.BLessonPerson;
......@@ -66,6 +67,9 @@ public class BLessonController extends PaginationController<BLesson> {
@Autowired
SendNoticeService sendNoticeService;
@Autowired
BLabelService bLabelService;
@Autowired
private Global global;
......@@ -788,7 +792,7 @@ public class BLessonController extends PaginationController<BLesson> {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.queryHomeBLessons(curUser));
bLabelService.queryBlabels("",curUser));
}
......
......@@ -1802,10 +1802,10 @@ public class BLessonServiceImpl implements BLessonService {
public List<BLesson> addNew(List<BLesson> result) {
//获取当前登录人信息
CurUser curUser = UserUtil.getCurUser();
// String userId = curUser.getUserId();
// String corpId = curUser.getCorpId();
String userId = "1042237478105227265";
String corpId = "6";
String userId = curUser.getUserId();
String corpId = curUser.getCorpId();
// String userId = "1042237478105227265";
// String corpId = "6";
log.info("-----------addNew---------当前登录人信息curUser----------"+curUser+"--------------------");
BMessage bMessage = new BMessage();
bMessage.setName(MessageEnum.NEWNOTICE.getName());
......
......@@ -89,8 +89,7 @@ libreoffice:
ip: mt_libre
port: 8997
mt:
api: http://192.168.5.201/api/
# api: http://221.239.114.20:6789/api/
api: 192.168.5.54/api/
eureka:
instance:
# hostname: localhost
......@@ -100,7 +99,7 @@ eureka:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://zx:zgiot@192.168.5.48:7001/eureka
defaultZone: http://zx:zgiot@192.168.5.40:7001/eureka/
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000
......
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