|
@@ -1,14 +1,31 @@
|
|
|
package cn.iocoder.yudao.module.as.service.financialaidstudentmange;
|
|
|
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.AidingStudentPersonManageInfoRespVO;
|
|
|
+import cn.iocoder.yudao.module.as.controller.admin.financialaidstudentmange.vo.FinancialAidStudentManagePageReqVO;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.financialaidstudentmange.vo.FinancialAidStudentManageRespVO;
|
|
|
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsmanage.AidingStudentsManageDO;
|
|
|
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentspersonmanage.AidingStudentsPersonManageDO;
|
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.financialaidstudentmange.FinancialAidStudentManageDO;
|
|
|
import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentsmanage.AidingStudentsManageMapper;
|
|
|
+import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentspersonmanage.AidingStudentsPersonManageMapper;
|
|
|
import cn.iocoder.yudao.module.as.dal.mysql.financialaidstudentmange.FinancialAidStudentManageMapper;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
|
|
+import static cn.iocoder.yudao.module.as.enums.ErrorCodeConstants.STUDENT_INFO_EXISTS;
|
|
|
+
|
|
|
/**
|
|
|
* @autor WoVoM
|
|
|
* @data 2024/7/16 14:56
|
|
@@ -17,19 +34,32 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
public class FinancialAidStudentManageServiceImpl extends ServiceImpl<FinancialAidStudentManageMapper, FinancialAidStudentManageDO> implements FinancialAidStudentManageService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AdminUserApi adminUserApi;
|
|
|
+
|
|
|
@Autowired
|
|
|
- private AidingStudentsManageMapper aidingStudentsManageMapper;
|
|
|
+ private AidingStudentsPersonManageMapper aidingStudentsPersonManageMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FinancialAidStudentManageMapper financialAidStudentManageMapper;
|
|
|
|
|
|
/**
|
|
|
* 先将家庭困难信息认定结果返回
|
|
|
- *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public FinancialAidStudentManageRespVO beforeuploadAidingStudentsManage() {
|
|
|
- return null;
|
|
|
+ public FinancialAidStudentManageRespVO beforeuploadAidingStudentsManage(Integer manageId, Integer collegeManagerId) {
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(getLoginUser().getId());
|
|
|
+ AidingStudentsPersonManageDO aDo = aidingStudentsPersonManageMapper
|
|
|
+ .selectOne(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(AidingStudentsPersonManageDO::getStudentId, user.getStudentId())
|
|
|
+ .eq(AidingStudentsPersonManageDO::getManageId, manageId)
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeManageId, collegeManagerId));
|
|
|
+ return BeanUtils.toBean(aDo, FinancialAidStudentManageRespVO.class);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 学生上传材料
|
|
|
* @param uploadVO
|
|
@@ -37,8 +67,41 @@ public class FinancialAidStudentManageServiceImpl extends ServiceImpl<FinancialA
|
|
|
@Override
|
|
|
public void uploadAidingStudentsManage(FinancialAidStudentManageRespVO uploadVO) {
|
|
|
// 0.验证
|
|
|
-
|
|
|
+ FinancialAidStudentManageDO aDo = financialAidStudentManageMapper
|
|
|
+ .selectOne(new LambdaQueryWrapper<FinancialAidStudentManageDO>()
|
|
|
+ .eq(FinancialAidStudentManageDO::getStudentId, uploadVO.getStudentId())
|
|
|
+ .eq(FinancialAidStudentManageDO::getManageId, uploadVO.getManageId())
|
|
|
+ .eq(FinancialAidStudentManageDO::getCollegeMangeId,uploadVO.getCollegeManageId()));
|
|
|
+ if(aDo != null){
|
|
|
+ throw exception(STUDENT_INFO_EXISTS);
|
|
|
+ }
|
|
|
// 1.上传
|
|
|
+ financialAidStudentManageMapper.insert(BeanUtils.toBean(uploadVO,FinancialAidStudentManageDO.class));
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 分页
|
|
|
+ * @param pageReqVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public PageResult<FinancialAidStudentManageRespVO> getAidingStudentsPersonManagePage(FinancialAidStudentManagePageReqVO pageReqVO) {
|
|
|
+ List<FinancialAidStudentManageDO> allList = financialAidStudentManageMapper
|
|
|
+ .selectList(new LambdaQueryWrapper<FinancialAidStudentManageDO>()
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getCollegeName()), FinancialAidStudentManageDO::getCollegeName, pageReqVO.getCollegeName())
|
|
|
+ .eq(pageReqVO.getManageId() != null ,FinancialAidStudentManageDO::getManageId, pageReqVO.getManageId())
|
|
|
+ .eq(pageReqVO.getCollegeManageId() != null,FinancialAidStudentManageDO::getCollegeMangeId, pageReqVO.getCollegeManageId())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getMajor()), FinancialAidStudentManageDO::getMajor, pageReqVO.getMajor())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getGrade()), FinancialAidStudentManageDO::getGrade, pageReqVO.getGrade())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getClassName()), FinancialAidStudentManageDO::getClassName, pageReqVO.getClassName())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getNickname()), FinancialAidStudentManageDO::getNickname, pageReqVO.getNickname())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getStudentId()), FinancialAidStudentManageDO::getStudentId, pageReqVO.getStudentId())
|
|
|
+ .orderByAsc(FinancialAidStudentManageDO::getSort)
|
|
|
+ );
|
|
|
+ return new PageResult<>(BeanUtils.toBean(allList, FinancialAidStudentManageRespVO.class), (long) allList.size());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|