|
@@ -1,5 +1,6 @@
|
|
package com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service;
|
|
package com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -15,6 +16,9 @@ import com.jeeplus.sys.utils.StringUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.test.cw.common.CommonUtils;
|
|
import com.jeeplus.test.cw.common.CommonUtils;
|
|
import com.jeeplus.test.cw.contractRegistration.service.ContractInfoService;
|
|
import com.jeeplus.test.cw.contractRegistration.service.ContractInfoService;
|
|
|
|
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
|
|
|
|
+import com.jeeplus.test.cw.projectRecords.service.CwProjectRecordsService;
|
|
|
|
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.*;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.*;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.*;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.*;
|
|
@@ -30,6 +34,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: 王强
|
|
* @author: 王强
|
|
@@ -74,6 +79,9 @@ public class CwReimbursementInfoService {
|
|
@Resource
|
|
@Resource
|
|
private OfficeService officeService;
|
|
private OfficeService officeService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private CwProjectRecordsService cwProjectRecordsService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 报告号查询
|
|
* 报告号查询
|
|
*/
|
|
*/
|
|
@@ -102,7 +110,7 @@ public class CwReimbursementInfoService {
|
|
queryWrapper.eq("a.del_flag", 0);
|
|
queryWrapper.eq("a.del_flag", 0);
|
|
// 报销项目
|
|
// 报销项目
|
|
if (StringUtils.isNotEmpty(dto.getProject())) {
|
|
if (StringUtils.isNotEmpty(dto.getProject())) {
|
|
- queryWrapper.apply("(b.project_id = {0} OR p.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("(b.project_id Like {0} OR p.project_name LIKE {1})", "%" + dto.getProject() + "%", "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b3.project_id = {0} OR p3.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b3.project_id = {0} OR p3.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b4.project_id = {0} OR b4.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b4.project_id = {0} OR b4.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
queryWrapper.or().apply("(b5.project_id = {0} OR b5.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
@@ -201,7 +209,16 @@ public class CwReimbursementInfoService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}*/
|
|
}*/
|
|
- return infoMapper.findList(page, queryWrapper, officeIds.toString());
|
|
|
|
|
|
+ IPage<RetureListDto> list = infoMapper.findList(page, queryWrapper, officeIds.toString());
|
|
|
|
+ list.getRecords().stream().forEach(item -> {
|
|
|
|
+ if (StringUtils.isNotBlank(item.getSourceType()) && "1".equals(item.getSourceType())) { //项目报销
|
|
|
|
+ if (StringUtils.isNotBlank(item.getProjectId())) {
|
|
|
|
+ String proName = selectProjectByIds(item.getProjectId());
|
|
|
|
+ item.setProjectName(proName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
|
|
public IPage<ProgramProjectListInfo> projectList(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
|
|
public IPage<ProgramProjectListInfo> projectList(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
|
|
@@ -467,7 +484,16 @@ public class CwReimbursementInfoService {
|
|
// detailInfoLambdaQueryWrapper.orderByAsc(CwReimbursementDetailInfo::getNumber);
|
|
// detailInfoLambdaQueryWrapper.orderByAsc(CwReimbursementDetailInfo::getNumber);
|
|
// List<CwReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
// List<CwReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
// 项目报销详情
|
|
// 项目报销详情
|
|
- dto.setDetailInfos(infoMapper.getDetailList(id));
|
|
|
|
|
|
+ List<CwReimbursementDetailInfo> detailList = infoMapper.getDetailList(id);
|
|
|
|
+ detailList.stream().forEach(projectDetail -> {
|
|
|
|
+ if (StringUtils.isNotBlank(projectDetail.getProjectId())) {
|
|
|
|
+ String proName = selectProjectByIds(projectDetail.getProjectId());
|
|
|
|
+ projectDetail.setProjectName(proName);
|
|
|
|
+ } else {
|
|
|
|
+ projectDetail.setProjectName("");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ dto.setDetailInfos(detailList);
|
|
// 合同报销详情
|
|
// 合同报销详情
|
|
dto.setDetailInfoContracts(infoMapper.getContractDetailList(id));
|
|
dto.setDetailInfoContracts(infoMapper.getContractDetailList(id));
|
|
// 报告报销详情
|
|
// 报告报销详情
|
|
@@ -493,6 +519,22 @@ public class CwReimbursementInfoService {
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据项目id查询项目名称
|
|
|
|
+ * @param ids 以逗号分隔的多个项目id字符串
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public String selectProjectByIds(String ids) {
|
|
|
|
+ String projectName = "";
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
+ List<String> idList = Arrays.asList(split);
|
|
|
|
+ List<CwProjectRecords> list = cwProjectRecordsService.list(new LambdaQueryWrapper<CwProjectRecords>().in(CwProjectRecords::getId, idList));
|
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
|
+ projectName = list.stream().map(CwProjectRecords::getProjectName).collect(Collectors.joining(","));
|
|
|
|
+ }
|
|
|
|
+ return projectName;
|
|
|
|
+ }
|
|
|
|
+
|
|
public Boolean checkNumber(String number) {
|
|
public Boolean checkNumber(String number) {
|
|
LambdaQueryWrapper<CwReimbursementAmountInfo> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CwReimbursementAmountInfo> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(CwReimbursementAmountInfo::getNumber, number);
|
|
wrapper.eq(CwReimbursementAmountInfo::getNumber, number);
|
|
@@ -652,4 +694,11 @@ public class CwReimbursementInfoService {
|
|
return iPage;
|
|
return iPage;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public List<CwProjectRecords> queryByProIds(String ids) {
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
+ List<String> idList = Arrays.asList(split);
|
|
|
|
+ List<CwProjectRecords> list = cwProjectRecordsService.list(new LambdaQueryWrapper<CwProjectRecords>().in(CwProjectRecords::getId, idList));
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|