This commit is contained in:
wangjinlei
2024-05-21 16:18:03 +08:00
parent 46f3c49197
commit f246c8a0a9

View File

@@ -9,6 +9,7 @@ import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.CourseMedicineMarketEntity;
import com.peanut.modules.common.entity.CourseToMedicineMarketEntity;
import com.peanut.modules.common.entity.CourseToSociologyMarketEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.master.service.CourseMedicineMarketService;
import com.peanut.modules.master.service.CourseService;
import com.peanut.modules.master.service.CourseToMedicineMarketService;
@@ -136,12 +137,12 @@ public class CourseMedicineMarketController {
* 获取未关联课程列表
*/
@RequestMapping("/getNotToMarketList")
public R getNotToMarketList(@RequestBody Map params){
List<Integer> collect1 = toMarketService.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId, params.get("marketId"))).stream().map(CourseToMedicineMarketEntity::getCourseId).collect(Collectors.toList());
public R getNotToMarketList(@RequestBody ParamTo param){
List<Integer> collect1 = toMarketService.getBaseMapper().selectList(new LambdaQueryWrapper<CourseToMedicineMarketEntity>().eq(CourseToMedicineMarketEntity::getMedicineMarketId, param.getId())).stream().map(CourseToMedicineMarketEntity::getCourseId).collect(Collectors.toList());
LambdaQueryWrapper<CourseEntity> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.notIn(collect1.size()>0,CourseEntity::getId,collect1);
wrapper1.like(StringUtils.isNotBlank(params.get("title").toString()),CourseEntity::getTitle,params.get("title").toString());
Page<CourseEntity> page1 = courseService.page(new Page<>(Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper1);
wrapper1.like(StringUtils.isNotBlank(param.getKeywords()),CourseEntity::getTitle,param.getKeywords());
Page<CourseEntity> page1 = courseService.page(new Page<>(param.getPage(), param.getLimit()), wrapper1);
return R.ok().put("page",page1);
}