|
@@ -813,6 +813,23 @@ public class ZsReimbursementInfoService {
|
|
|
return "操作成功";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据部门id查询
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getOfficeNameByIds(String ids){
|
|
|
+ List<String> deptIdList = new ArrayList<>();
|
|
|
+ if (ids != null && !ids.trim().isEmpty()) {
|
|
|
+ deptIdList = Arrays.stream(ids.split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(s -> !s.isEmpty())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<String> names = SpringUtil.getBean( IOfficeApi.class ).getOfficeNameByIds(deptIdList);
|
|
|
+ return String.join(",",names);
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
public ZsSaveInfoDto findById(String id) {
|
|
|
ZsSaveInfoDto dto = new ZsSaveInfoDto();
|
|
|
// 查询基础信息表
|
|
@@ -825,6 +842,7 @@ public class ZsReimbursementInfoService {
|
|
|
dto.setDepartmentName(byId.getName());
|
|
|
}
|
|
|
}
|
|
|
+ IUserApi userApi = SpringUtil.getBean(IUserApi.class);
|
|
|
|
|
|
// 查询详情列表
|
|
|
// LambdaQueryWrapper<ZsReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -833,21 +851,82 @@ public class ZsReimbursementInfoService {
|
|
|
// List<ZsReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
|
// 项目报销详情
|
|
|
List<ZsReimbursementDetailInfo> detailList = infoMapper.getDetailList(id);
|
|
|
+ detailList.stream().forEach(projectDetail -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(projectDetail.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(projectDetail.getUserId());
|
|
|
+ projectDetail.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(projectDetail.getDeptId());
|
|
|
+ projectDetail.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
dto.setDetailInfos(detailList);
|
|
|
- //dto.setDetailInfos(infoMapper.getDetailList(id));
|
|
|
// 合同报销详情
|
|
|
- dto.setDetailInfoContracts(infoMapper.getContractDetailList(id));
|
|
|
+ List<ZsReimbursementDetailInfoContract> contractDetailList = infoMapper.getContractDetailList(id);
|
|
|
+ contractDetailList.stream().forEach(contract -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(contract.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(contract.getUserId());
|
|
|
+ contract.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(contract.getDeptId());
|
|
|
+ contract.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoContracts(contractDetailList);
|
|
|
// 报告报销详情
|
|
|
- List<ZsReimbursementDetailInfoReport> detailInfoReports=infoMapper.getCwReportDetailList(id);
|
|
|
- dto.setDetailInfoReports(detailInfoReports);
|
|
|
-
|
|
|
- //dto.setDetailInfoReports(infoMapper.getReportDetailList(id));
|
|
|
+ List<ZsReimbursementDetailInfoReport> reportDetailList = infoMapper.getReportDetailList(id);
|
|
|
+ reportDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoReports(reportDetailList);
|
|
|
// 其他报销
|
|
|
- dto.setDetailInfoOthers(infoMapper.getOtherDetailList(id));
|
|
|
- // 中审项目报销
|
|
|
- dto.setDetailInfoProject(infoMapper.getZsProjectDetailList(id));
|
|
|
+ List<ZsReimbursementDetailInfoOther> otherDetailList = infoMapper.getOtherDetailList(id);
|
|
|
+ otherDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoOthers(otherDetailList);
|
|
|
// 采购报销
|
|
|
- dto.setDetailInfoProcured(infoMapper.getProcuredDetailList(id));
|
|
|
+ List<ZsReimbursementDetailInfoProcured> procuredDetailList = infoMapper.getProcuredDetailList(id);
|
|
|
+ procuredDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 中审项目报销
|
|
|
+ List<ZsReimbursementDetailInfoProject> zsProjectDetailList = infoMapper.getZsProjectDetailList(id);
|
|
|
+ zsProjectDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoProject(zsProjectDetailList);
|
|
|
+
|
|
|
// 查询专用发票信息列表
|
|
|
LambdaQueryWrapper<ZsReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
amountInfoLambdaQueryWrapper.eq(ZsReimbursementAmountInfo::getInfoId, id);
|
|
@@ -1220,22 +1299,89 @@ public class ZsReimbursementInfoService {
|
|
|
dto.setDepartmentName(byId.getName());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ IUserApi userApi = SpringUtil.getBean ( IUserApi.class );
|
|
|
// 查询详情列表
|
|
|
// LambdaQueryWrapper<ZsReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
// detailInfoLambdaQueryWrapper.eq(ZsReimbursementDetailInfo::getInfoId, id);
|
|
|
// detailInfoLambdaQueryWrapper.orderByAsc(ZsReimbursementDetailInfo::getNumber);
|
|
|
// List<ZsReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
|
// 项目报销详情
|
|
|
- dto.setDetailInfos(infoMapper.getDetailList(reimId));
|
|
|
+ List<ZsReimbursementDetailInfo> detailList = infoMapper.getDetailList(reimId);
|
|
|
+ detailList.stream().forEach(projectDetail -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(projectDetail.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(projectDetail.getUserId());
|
|
|
+ projectDetail.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(projectDetail.getDeptId());
|
|
|
+ projectDetail.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfos(detailList);
|
|
|
// 合同报销详情
|
|
|
- dto.setDetailInfoContracts(infoMapper.getContractDetailList(reimId));
|
|
|
+ List<ZsReimbursementDetailInfoContract> contractDetailList = infoMapper.getContractDetailList(reimId);
|
|
|
+ contractDetailList.stream().forEach(contract -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(contract.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(contract.getUserId());
|
|
|
+ contract.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(contract.getDeptId());
|
|
|
+ contract.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoContracts(contractDetailList);
|
|
|
// 报告报销详情
|
|
|
- dto.setDetailInfoReports(infoMapper.getReportDetailList(reimId));
|
|
|
+ List<ZsReimbursementDetailInfoReport> reportDetailList = infoMapper.getReportDetailList(reimId);
|
|
|
+ reportDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoReports(reportDetailList);
|
|
|
// 其他报销
|
|
|
- dto.setDetailInfoOthers(infoMapper.getOtherDetailList(reimId));
|
|
|
+ List<ZsReimbursementDetailInfoOther> otherDetailList = infoMapper.getOtherDetailList(reimId);
|
|
|
+ otherDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoOthers(otherDetailList);
|
|
|
// 采购报销
|
|
|
- dto.setDetailInfoProcured(infoMapper.getProcuredDetailList(reimId));
|
|
|
+ List<ZsReimbursementDetailInfoProcured> procuredDetailList = infoMapper.getProcuredDetailList(reimId);
|
|
|
+ procuredDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 中审项目报销
|
|
|
+ List<ZsReimbursementDetailInfoProject> zsProjectDetailList = infoMapper.getZsProjectDetailList(reimId);
|
|
|
+ zsProjectDetailList.stream().forEach(details -> {
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(details.getUserName())){
|
|
|
+ //处理用户名
|
|
|
+ String names = userApi.getNamesByIds(details.getUserId());
|
|
|
+ details.setUserName(names);
|
|
|
+ //处理部门名
|
|
|
+ String offices = getOfficeNameByIds(details.getDeptId());
|
|
|
+ details.setDeptName(offices);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dto.setDetailInfoProject(zsProjectDetailList);
|
|
|
// 查询专用发票信息列表
|
|
|
LambdaQueryWrapper<ZsReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
amountInfoLambdaQueryWrapper.eq(ZsReimbursementAmountInfo::getInfoId, reimId);
|