|
@@ -1,17 +1,23 @@
|
|
|
package cn.iocoder.yudao.module.as.service.aidingstudentscollegemanage;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsmanage.AidingStudentsManageDO;
|
|
|
+import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentsmanage.AidingStudentsManageMapper;
|
|
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
+
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.*;
|
|
|
+
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo.*;
|
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageDO;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
|
|
import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentscollegemanage.AidingStudentsCollegeManageMapper;
|
|
@@ -32,6 +38,8 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
|
|
|
@Resource
|
|
|
private AidingStudentsCollegeManageMapper aidingStudentsCollegeManageMapper;
|
|
|
@Resource
|
|
|
+ private AidingStudentsManageMapper aidingStudentsManageMapper;
|
|
|
+ @Resource
|
|
|
private AdminUserApi adminUserApi;
|
|
|
@Resource
|
|
|
private DeptApi deptApi;
|
|
@@ -39,10 +47,11 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
|
|
|
@Override
|
|
|
public Long createAidingStudentsCollegeManage(AidingStudentsCollegeManageSaveReqVO createReqVO) {
|
|
|
// 获得学院id
|
|
|
- Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
+ /*Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
- createReqVO.setCollegeId(collegeId);
|
|
|
-
|
|
|
+ createReqVO.setCollegeId(collegeId);*/
|
|
|
+ //改变状态
|
|
|
+ createReqVO.setComStatus(1);
|
|
|
// 插入
|
|
|
AidingStudentsCollegeManageDO aidingStudentsCollegeManage = BeanUtils.toBean(createReqVO, AidingStudentsCollegeManageDO.class);
|
|
|
aidingStudentsCollegeManageMapper.insert(aidingStudentsCollegeManage);
|
|
@@ -97,10 +106,57 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
|
|
|
//map.put("publicity", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
|
|
|
//进行中
|
|
|
map.put("ongoing", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 1)
|
|
|
- +aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
|
|
|
+ + aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
|
|
|
//已完成
|
|
|
map.put("completed", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 3));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<AdminUserRespDTO> getCollegeAllStudent() {
|
|
|
+ //获得学院id
|
|
|
+ Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
|
|
|
+ Long collegeId = deptApi.getCollegeId(deptId);
|
|
|
+
|
|
|
+
|
|
|
+ List<DeptRespDTO> childDeptList = deptApi.getChildDeptList(collegeId);
|
|
|
+ List<Long> deptIds = new ArrayList<>();
|
|
|
+ deptIds.add(collegeId);
|
|
|
+ for (DeptRespDTO deptRespDTO : childDeptList) {
|
|
|
+ deptIds.add(deptRespDTO.getId());
|
|
|
+ }
|
|
|
+ List<AdminUserRespDTO> userList = adminUserApi.getUserListByDeptIds(deptIds);
|
|
|
+ return userList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageResult<AidingStudentsCollegeManageProjectInfoRespVO> getProjectInfoPage(AidingStudentsCollegeManageProjectInfoPageRespVO pageReqVO) {
|
|
|
+ Integer pageNo = pageReqVO.getPageNo();
|
|
|
+ Integer pageSize = pageReqVO.getPageSize();
|
|
|
+ Integer offset = (pageNo - 1) *pageSize;
|
|
|
+ List<AidingStudentsCollegeManageProjectInfoRespVO> aidingStudentsCollegeManageProjectInfoRespVOS = aidingStudentsCollegeManageMapper.selectProjectInfoPage(pageSize,offset);
|
|
|
+ if (aidingStudentsCollegeManageProjectInfoRespVOS != null){
|
|
|
+ return new PageResult<>(aidingStudentsCollegeManageProjectInfoRespVOS,aidingStudentsCollegeManageMapper.selectProjectInfoPageCount());
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /*private List<AidingStudentsCollegeManageProjectInfoRespVO> merge2AidingStudentsCollegeManageProjectInfoRespVO
|
|
|
+ (List<AidingStudentsManageDO> aidingStudentsManageDOS, List<AidingStudentsCollegeManageDO> aidingStudentsCollegeManageDOS) {
|
|
|
+ List<AidingStudentsCollegeManageProjectInfoRespVO> aidingStudentsCollegeManageProjectInfoRespVOS = new ArrayList<>();
|
|
|
+
|
|
|
+ aidingStudentsManageDOS.forEach(aidingStudentsManageDO -> {
|
|
|
+ List<AidingStudentsCollegeManageDO> aidingStudentsCollegeManageDO = aidingStudentsCollegeManageMapper.selectList(Wrappers.lambdaQuery(AidingStudentsCollegeManageDO.class)
|
|
|
+ .eq(AidingStudentsCollegeManageDO::getManageId, aidingStudentsManageDO.getId()));
|
|
|
+ if (aidingStudentsCollegeManageDO == null){
|
|
|
+ aidingStudentsCollegeManageProjectInfoRespVOS.add(AidingStudentsCollegeManageProjectInfoRespVO.builder()
|
|
|
+ .projectInfo(aidingStudentsManageDO)
|
|
|
+ .aidingStudentsCollegeManageDO(null)
|
|
|
+ .build());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
}
|