Commit 87016ae9 authored by luzhuang's avatar luzhuang

fix: 修改label添加newcount逻辑

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