|
@@ -3,10 +3,12 @@ package com.zjugis.business.service.impl;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.zjugis.business.bean.dto.LoanDto;
|
|
|
import com.zjugis.business.bean.entity.Loan;
|
|
|
+import com.zjugis.business.bean.entity.Project;
|
|
|
import com.zjugis.business.bean.response.LoanRespense;
|
|
|
import com.zjugis.business.mapper.LoanMapper;
|
|
|
import com.zjugis.business.service.CommonService;
|
|
|
import com.zjugis.business.service.LoanService;
|
|
|
+import com.zjugis.business.service.ProjectService;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import com.zjugis.module.system.api.user.AdminUserApi;
|
|
@@ -19,6 +21,8 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
+import static com.zjugis.framework.common.util.collection.CollectionUtils.convertList;
|
|
|
+
|
|
|
/**
|
|
|
* 借款申请表(LOAN)表服务实现类
|
|
|
*
|
|
@@ -35,16 +39,16 @@ public class LoanServiceImpl implements LoanService {
|
|
|
|
|
|
@Resource
|
|
|
private AdminUserApi adminUserApi;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProjectService projectService;
|
|
|
@Override
|
|
|
public Page<Loan> page(LoanDto loan) {
|
|
|
if(loan.getDeptId()!=null){
|
|
|
Set<String> dept=commonService.getDeptCondition(loan.getDeptId());
|
|
|
- List<String> projectId=new ArrayList<>();
|
|
|
- CommonResult<List<AdminUserRespDTO>> userList=adminUserApi.getUserListByDeptIds(dept);
|
|
|
- for(AdminUserRespDTO user:userList.getData()){
|
|
|
- projectId.add(user.getId());
|
|
|
- }
|
|
|
- loan.setUserList(projectId);
|
|
|
+ loan.setUserDeptList(dept);
|
|
|
+ List<Project> projects = projectService.selectByDeptId(loan.getDeptId());
|
|
|
+ loan.setProjectIds(convertList(projects, Project::getId));
|
|
|
loan.setDeptId(null);
|
|
|
}
|
|
|
Page<Loan> page = new Page<>(loan.getPageNo(),loan.getPageSize());
|
|
@@ -111,6 +115,13 @@ public class LoanServiceImpl implements LoanService {
|
|
|
|
|
|
@Override
|
|
|
public LoanRespense overview(LoanDto loan) {
|
|
|
+ if(loan.getDeptId()!=null){
|
|
|
+ Set<String> dept=commonService.getDeptCondition(loan.getDeptId());
|
|
|
+ loan.setUserDeptList(dept);
|
|
|
+ List<Project> projects = projectService.selectByDeptId(loan.getDeptId());
|
|
|
+ loan.setProjectIds(convertList(projects, Project::getId));
|
|
|
+ loan.setDeptId(null);
|
|
|
+ }
|
|
|
return loanMapper.overview(loan);
|
|
|
}
|
|
|
}
|