|
|
@@ -14,14 +14,17 @@ import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.dto.AddBaseClassDynamicsDto;
|
|
|
import com.xjrsoft.module.base.dto.BaseClassDynamicsPageDto;
|
|
|
+import com.xjrsoft.module.base.dto.BaseClassDynamicsRelationPageDto;
|
|
|
import com.xjrsoft.module.base.dto.UpdateBaseClassDynamicsDto;
|
|
|
import com.xjrsoft.module.base.entity.BaseClassDynamics;
|
|
|
import com.xjrsoft.module.base.entity.BaseClassDynamicsRelation;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassDynamicsService;
|
|
|
import com.xjrsoft.module.base.vo.BaseClassDynamicsPageVo;
|
|
|
+import com.xjrsoft.module.base.vo.BaseClassDynamicsRelationPageVo;
|
|
|
import com.xjrsoft.module.base.vo.BaseClassDynamicsVo;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.system.service.IFileService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -37,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -64,17 +68,44 @@ public class BaseClassDynamicsController {
|
|
|
public RT<PageOutput<BaseClassDynamicsPageVo>> page(@Valid BaseClassDynamicsPageDto dto) {
|
|
|
long userId = StpUtil.getLoginIdAsLong();
|
|
|
MPJLambdaWrapper<BaseClassDynamics> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
+
|
|
|
queryWrapper
|
|
|
+ .select(BaseClassDynamics::getId)
|
|
|
.select(BaseClassDynamics.class, x -> VoToColumnUtil.fieldsToColumns(BaseClassDynamicsPageVo.class).contains(x.getProperty()))
|
|
|
.innerJoin(BaseClassDynamicsRelation.class, BaseClassDynamicsRelation::getBaseClassDynamicsId, BaseClassDynamics::getId)
|
|
|
.eq(BaseClassDynamicsRelation::getUserId, userId)
|
|
|
.orderByDesc(BaseClassDynamics::getId)
|
|
|
;
|
|
|
+ if(dto.getStartDate() != null && dto.getEndDate() != null){
|
|
|
+ queryWrapper.between(BaseClassDynamics::getCreateDate, dto.getStartDate().atStartOfDay(), dto.getEndDate().atTime(23,59,59));
|
|
|
+ }
|
|
|
+
|
|
|
IPage<BaseClassDynamics> page = baseClassDynamicsService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
PageOutput<BaseClassDynamicsPageVo> pageOutput = ConventPage.getPageOutput(page, BaseClassDynamicsPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/reader-page")
|
|
|
+ @ApiOperation(value = "班级动态读者信息(分页)")
|
|
|
+ @SaCheckPermission("baseclassdynamics:detail")
|
|
|
+ @XjrLog(value = "班级动态读者信息(分页)")
|
|
|
+ public RT<PageOutput<BaseClassDynamicsRelationPageVo>> page(@Valid BaseClassDynamicsRelationPageDto dto) {
|
|
|
+ MPJLambdaWrapper<User> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .select(User::getId)
|
|
|
+ .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
|
|
|
+ .select(BaseClassDynamicsRelation::getReadDate)
|
|
|
+ .select(BaseClassDynamicsRelation::getReadMark)
|
|
|
+ .innerJoin(BaseClassDynamicsRelation.class, BaseClassDynamicsRelation::getUserId, User::getId)
|
|
|
+ .innerJoin(BaseStudent.class, BaseStudent::getUserId, User::getId)
|
|
|
+ .eq(dto.getReadMark() != null, BaseClassDynamicsRelation::getReadMark, dto.getReadMark())
|
|
|
+ .eq(BaseClassDynamicsRelation::getBaseClassDynamicsId, dto.getBaseClassDynamicsId())
|
|
|
+ ;
|
|
|
+ IPage<BaseClassDynamicsRelationPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), BaseClassDynamicsRelationPageVo.class, queryWrapper);
|
|
|
+ PageOutput<BaseClassDynamicsRelationPageVo> pageOutput = ConventPage.getPageOutput(page, BaseClassDynamicsRelationPageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping(value = "/release-page")
|
|
|
@ApiOperation(value = "班主任发布列表(分页)")
|
|
|
@SaCheckPermission("baseclassdynamics:detail")
|