|
@@ -1,5 +1,6 @@
|
|
package com.jeeplus.test.reimbursement.reimbursementInfo.service;
|
|
package com.jeeplus.test.reimbursement.reimbursementInfo.service;
|
|
|
|
|
|
|
|
+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;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -10,18 +11,16 @@ import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.sys.domain.Office;
|
|
import com.jeeplus.sys.domain.Office;
|
|
import com.jeeplus.sys.mapper.OfficeMapper;
|
|
import com.jeeplus.sys.mapper.OfficeMapper;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
|
+import com.jeeplus.sys.utils.DictUtils;
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
|
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
|
|
import com.jeeplus.test.manytomany.domain.Student;
|
|
import com.jeeplus.test.manytomany.domain.Student;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.domain.ReimbursementAmountInfo;
|
|
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfo;
|
|
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.domain.ReimbursementInfo;
|
|
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.mapper.ReimbursementAmountInfoMapper;
|
|
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.mapper.ReimbursementDetailInfoMapper;
|
|
|
|
-import com.jeeplus.test.reimbursement.reimbursementInfo.mapper.ReimbursementInfoMapper;
|
|
|
|
|
|
+import com.jeeplus.test.reimbursement.reimbursementInfo.domain.*;
|
|
|
|
+import com.jeeplus.test.reimbursement.reimbursementInfo.mapper.*;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.QueryListDto;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.QueryListDto;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.SaveInfoDto;
|
|
import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.SaveInfoDto;
|
|
@@ -61,6 +60,15 @@ public class ReimbursementInfoService {
|
|
@Autowired
|
|
@Autowired
|
|
private OfficeMapper officeMapper;
|
|
private OfficeMapper officeMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ReimbursementDetailInfoContractMapper reimbursementDetailInfoContractMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ReimbursementDetailInfoOtherMapper reimbursementDetailInfoOtherMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ReimbursementDetailInfoProcuredMapper reimbursementDetailInfoProcuredMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 列表查询
|
|
* 列表查询
|
|
*/
|
|
*/
|
|
@@ -74,7 +82,10 @@ public class ReimbursementInfoService {
|
|
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 b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("(b.project_id = {0} OR p.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() + "%");
|
|
|
|
+
|
|
}
|
|
}
|
|
// 报销时间
|
|
// 报销时间
|
|
if (dto.getDates() != null) {
|
|
if (dto.getDates() != null) {
|
|
@@ -86,7 +97,11 @@ public class ReimbursementInfoService {
|
|
}
|
|
}
|
|
// 报销人
|
|
// 报销人
|
|
if (StringUtils.isNotEmpty(dto.getReimBy())) {
|
|
if (StringUtils.isNotEmpty(dto.getReimBy())) {
|
|
- queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b5.user_id = {0} OR us5.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+
|
|
}
|
|
}
|
|
// 报销状态
|
|
// 报销状态
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
@@ -94,29 +109,54 @@ public class ReimbursementInfoService {
|
|
}
|
|
}
|
|
// 报销部门
|
|
// 报销部门
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
- queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b5.dept_id = {0} OR so5.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+
|
|
}
|
|
}
|
|
// 报销类别
|
|
// 报销类别
|
|
if (StringUtils.isNotEmpty(dto.getRemiType())) {
|
|
if (StringUtils.isNotEmpty(dto.getRemiType())) {
|
|
- queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
|
|
+ queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+
|
|
}
|
|
}
|
|
// 报销金额
|
|
// 报销金额
|
|
if (dto.getAmounts() != null) {
|
|
if (dto.getAmounts() != null) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
|
|
- queryWrapper.ge("b.number", Double.parseDouble(dto.getAmounts()[0]));
|
|
|
|
|
|
+ queryWrapper.and(w->
|
|
|
|
+ w.ge("b.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b2.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b4.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b5.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ );
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
|
|
- queryWrapper.le("b.number", Double.parseDouble(dto.getAmounts()[1]));
|
|
|
|
|
|
+ queryWrapper.and(w->
|
|
|
|
+ w.le("b.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b2.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b4.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b5.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 报告号
|
|
// 报告号
|
|
if (StringUtils.isNotEmpty(dto.getReportNumber())) {
|
|
if (StringUtils.isNotEmpty(dto.getReportNumber())) {
|
|
queryWrapper.like("b.report_number", dto.getReportNumber());
|
|
queryWrapper.like("b.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b2.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b4.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b5.report_number", dto.getReportNumber());
|
|
|
|
+ }
|
|
|
|
+ // 报销类型
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceType())) {
|
|
|
|
+ queryWrapper.eq("a.source_type", dto.getSourceType());
|
|
}
|
|
}
|
|
return infoMapper.findList(page, queryWrapper);
|
|
return infoMapper.findList(page, queryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
- public String save(SaveInfoDto dto) throws Exception{
|
|
|
|
|
|
+ public ReimbursementInfo save(SaveInfoDto dto) throws Exception{
|
|
// 获取当前登录人信息
|
|
// 获取当前登录人信息
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
@@ -126,7 +166,7 @@ public class ReimbursementInfoService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public String add(SaveInfoDto dto, UserDTO userDTO) throws Exception{
|
|
|
|
|
|
+ public ReimbursementInfo add(SaveInfoDto dto, UserDTO userDTO) throws Exception{
|
|
// 生成id
|
|
// 生成id
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
// 生成编号
|
|
// 生成编号
|
|
@@ -142,22 +182,38 @@ public class ReimbursementInfoService {
|
|
info.setUpdateDate(new Date());
|
|
info.setUpdateDate(new Date());
|
|
info.setDelFlag(0);
|
|
info.setDelFlag(0);
|
|
infoMapper.insert(info);
|
|
infoMapper.insert(info);
|
|
- // 保存详情列表信息
|
|
|
|
|
|
+ // 保存项目详情列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
for (ReimbursementDetailInfo detailInfo : dto.getDetailInfos()) {
|
|
for (ReimbursementDetailInfo detailInfo : dto.getDetailInfos()) {
|
|
- // 生成id
|
|
|
|
- String detailId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
- detailInfo.setId(detailId);
|
|
|
|
- detailInfo.setCreateBy(userDTO.getId());
|
|
|
|
- detailInfo.setCreateDate(new Date());
|
|
|
|
- detailInfo.setUpdateBy(userDTO.getId());
|
|
|
|
- detailInfo.setUpdateDate(new Date());
|
|
|
|
- detailInfo.setDelFlag(0);
|
|
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
detailInfo.setInfoId(id);
|
|
detailInfo.setInfoId(id);
|
|
detailInfoMapper.insert(detailInfo);
|
|
detailInfoMapper.insert(detailInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 保存合同详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
|
|
+ for (ReimbursementDetailInfoContract detailInfo : dto.getDetailInfoContracts()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
|
+ reimbursementDetailInfoContractMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存其他报销详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoOthers())) {
|
|
|
|
+ for (ReimbursementDetailInfoOther detailInfo : dto.getDetailInfoOthers()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
|
+ reimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存采购报销详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoProcured())) {
|
|
|
|
+ for (ReimbursementDetailInfoProcured detailInfo : dto.getDetailInfoProcured()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
|
+ reimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 保存专用发票列表信息
|
|
// 保存专用发票列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
@@ -178,10 +234,10 @@ public class ReimbursementInfoService {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
workContractService.saveFiles(dto.getFiles(), userDTO, id);
|
|
workContractService.saveFiles(dto.getFiles(), userDTO, id);
|
|
}
|
|
}
|
|
- return id;
|
|
|
|
|
|
+ return info;
|
|
}
|
|
}
|
|
|
|
|
|
- public String update(SaveInfoDto dto, UserDTO userDTO) {
|
|
|
|
|
|
+ public ReimbursementInfo update(SaveInfoDto dto, UserDTO userDTO) {
|
|
// 修改基础信息
|
|
// 修改基础信息
|
|
ReimbursementInfo info = new ReimbursementInfo();
|
|
ReimbursementInfo info = new ReimbursementInfo();
|
|
BeanUtils.copyProperties(dto, info);
|
|
BeanUtils.copyProperties(dto, info);
|
|
@@ -193,21 +249,55 @@ public class ReimbursementInfoService {
|
|
LambdaQueryWrapper<ReimbursementDetailInfo> detailWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReimbursementDetailInfo> detailWrapper = new LambdaQueryWrapper<>();
|
|
detailWrapper.eq(ReimbursementDetailInfo::getInfoId, dto.getId());
|
|
detailWrapper.eq(ReimbursementDetailInfo::getInfoId, dto.getId());
|
|
detailInfoMapper.delete(detailWrapper);
|
|
detailInfoMapper.delete(detailWrapper);
|
|
|
|
+ // 删除合同列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoContract> detailWrapperContract = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperContract.eq(ReimbursementDetailInfoContract::getInfoId, dto.getId());
|
|
|
|
+ reimbursementDetailInfoContractMapper.delete(detailWrapperContract);
|
|
|
|
+ // 删除其他报销表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoOther> detailWrapperOthers = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperOthers.eq(ReimbursementDetailInfoOther::getInfoId, dto.getId());
|
|
|
|
+ reimbursementDetailInfoOtherMapper.delete(detailWrapperOthers);
|
|
|
|
+ // 删除采购报销表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoProcured> detailWrapperProcured = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperProcured.eq(ReimbursementDetailInfoProcured::getInfoId, dto.getId());
|
|
|
|
+ reimbursementDetailInfoProcuredMapper.delete(detailWrapperProcured);
|
|
|
|
+
|
|
|
|
+ // 保存项目详情列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
for (ReimbursementDetailInfo detailInfo : dto.getDetailInfos()) {
|
|
for (ReimbursementDetailInfo detailInfo : dto.getDetailInfos()) {
|
|
- // 生成id
|
|
|
|
- String detailId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
- detailInfo.setId(detailId);
|
|
|
|
- detailInfo.setCreateBy(userDTO.getId());
|
|
|
|
- detailInfo.setCreateDate(new Date());
|
|
|
|
- detailInfo.setUpdateBy(userDTO.getId());
|
|
|
|
- detailInfo.setUpdateDate(new Date());
|
|
|
|
- detailInfo.setDelFlag(0);
|
|
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setInfoId(dto.getId());
|
|
|
|
+ detailInfo.setId("");
|
|
detailInfoMapper.insert(detailInfo);
|
|
detailInfoMapper.insert(detailInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 保存合同详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
|
|
+ for (ReimbursementDetailInfoContract detailInfo : dto.getDetailInfoContracts()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
|
+ detailInfo.setId("");
|
|
|
|
+ reimbursementDetailInfoContractMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存其他报销详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoOthers())) {
|
|
|
|
+ for (ReimbursementDetailInfoOther detailInfo : dto.getDetailInfoOthers()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
|
+ detailInfo.setId("");
|
|
|
|
+ reimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存采购报销详情列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoProcured())) {
|
|
|
|
+ for (ReimbursementDetailInfoProcured detailInfo : dto.getDetailInfoProcured()) {
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
|
+ detailInfo.setId("");
|
|
|
|
+ reimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 修改专用发票信息列表
|
|
// 修改专用发票信息列表
|
|
// 删除原有数据
|
|
// 删除原有数据
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
@@ -232,16 +322,28 @@ public class ReimbursementInfoService {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
workContractService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
workContractService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
}
|
|
}
|
|
- return dto.getId();
|
|
|
|
|
|
+ return info;
|
|
}
|
|
}
|
|
|
|
|
|
public String remove(String id) {
|
|
public String remove(String id) {
|
|
// 删除基础信息表
|
|
// 删除基础信息表
|
|
infoMapper.deleteById(id);
|
|
infoMapper.deleteById(id);
|
|
// 删除详情列表
|
|
// 删除详情列表
|
|
- LambdaQueryWrapper<ReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- detailInfoLambdaQueryWrapper.eq(ReimbursementDetailInfo::getInfoId, id);
|
|
|
|
- detailInfoMapper.delete(detailInfoLambdaQueryWrapper);
|
|
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfo> detailWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapper.eq(ReimbursementDetailInfo::getInfoId, id);
|
|
|
|
+ detailInfoMapper.delete(detailWrapper);
|
|
|
|
+ // 删除合同列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoContract> detailWrapperContract = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperContract.eq(ReimbursementDetailInfoContract::getInfoId, id);
|
|
|
|
+ reimbursementDetailInfoContractMapper.delete(detailWrapperContract);
|
|
|
|
+ // 删除其他报销列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoOther> detailWrapperOther = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperOther.eq(ReimbursementDetailInfoOther::getInfoId, id);
|
|
|
|
+ reimbursementDetailInfoOtherMapper.delete(detailWrapperOther);
|
|
|
|
+ // 删除采购报销列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementDetailInfoProcured> detailWrapperProcured = new LambdaQueryWrapper<>();
|
|
|
|
+ detailWrapperProcured.eq(ReimbursementDetailInfoProcured::getInfoId, id);
|
|
|
|
+ reimbursementDetailInfoProcuredMapper.delete(detailWrapperProcured);
|
|
// 删除专用发票信息列表
|
|
// 删除专用发票信息列表
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
@@ -257,25 +359,36 @@ public class ReimbursementInfoService {
|
|
SaveInfoDto dto = new SaveInfoDto();
|
|
SaveInfoDto dto = new SaveInfoDto();
|
|
// 查询基础信息表
|
|
// 查询基础信息表
|
|
ReimbursementInfo info = infoMapper.selectById(id);
|
|
ReimbursementInfo info = infoMapper.selectById(id);
|
|
- BeanUtils.copyProperties(info, dto);
|
|
|
|
- // 查询详情列表
|
|
|
|
- LambdaQueryWrapper<ReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- detailInfoLambdaQueryWrapper.eq(ReimbursementDetailInfo::getInfoId, id);
|
|
|
|
- List<ReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
|
|
- dto.setDetailInfos(detailInfos);
|
|
|
|
- // 查询专用发票信息列表
|
|
|
|
- LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
|
|
- List<ReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
|
|
- dto.setAmountInfos(amountInfos);
|
|
|
|
- // 查询附件信息
|
|
|
|
- List<WorkAttachmentDto> files = infoMapper.findFiles(id);
|
|
|
|
- if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
- for (WorkAttachmentDto i : files) {
|
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(info)){
|
|
|
|
+ BeanUtils.copyProperties(info, dto);
|
|
|
|
+ if(StringUtils.isNotBlank(info.getDepartment())) {
|
|
|
|
+ Office byId = officeMapper.selectById(info.getDepartment());
|
|
|
|
+ if (ObjectUtil.isNotEmpty(byId)) {
|
|
|
|
+ dto.setDepartmentName(byId.getName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ // 项目报销详情
|
|
|
|
+ dto.setDetailInfos(infoMapper.getDetailList(id));
|
|
|
|
+ // 合同报销详情
|
|
|
|
+ dto.setDetailInfoContracts(infoMapper.getContractDetailList(id));
|
|
|
|
+ // 其他报销
|
|
|
|
+ dto.setDetailInfoOthers(infoMapper.getOtherDetailList(id));
|
|
|
|
+ // 采购报销
|
|
|
|
+ dto.setDetailInfoProcured(infoMapper.getProcuredDetailList(id));
|
|
|
|
+ // 查询专用发票信息列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
|
|
+ List<ReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
|
|
+ dto.setAmountInfos(amountInfos);
|
|
|
|
+ // 查询附件信息
|
|
|
|
+ List<WorkAttachmentDto> files = infoMapper.findFiles(id);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
+ for (WorkAttachmentDto i : files) {
|
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dto.setFiles(files);
|
|
}
|
|
}
|
|
- dto.setFiles(files);
|
|
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -451,7 +564,10 @@ public class ReimbursementInfoService {
|
|
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 b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("(b.project_id = {0} OR p.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() + "%");
|
|
|
|
+
|
|
}
|
|
}
|
|
// 报销时间
|
|
// 报销时间
|
|
if (dto.getDates() != null) {
|
|
if (dto.getDates() != null) {
|
|
@@ -463,7 +579,10 @@ public class ReimbursementInfoService {
|
|
}
|
|
}
|
|
// 报销人
|
|
// 报销人
|
|
if (StringUtils.isNotEmpty(dto.getReimBy())) {
|
|
if (StringUtils.isNotEmpty(dto.getReimBy())) {
|
|
- queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("( b.user_id = {0} OR us.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b2.user_id = {0} OR us2.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b4.user_id = {0} OR us4.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b5.user_id = {0} OR us5.name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
|
|
}
|
|
}
|
|
// 报销状态
|
|
// 报销状态
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
@@ -471,24 +590,47 @@ public class ReimbursementInfoService {
|
|
}
|
|
}
|
|
// 报销部门
|
|
// 报销部门
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
- queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
|
|
+ queryWrapper.apply("( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b2.dept_id = {0} OR so2.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b4.dept_id = {0} OR so4.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
|
|
+ queryWrapper.or().apply("( b5.dept_id = {0} OR so5.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
}
|
|
}
|
|
// 报销类别
|
|
// 报销类别
|
|
if (StringUtils.isNotEmpty(dto.getRemiType())) {
|
|
if (StringUtils.isNotEmpty(dto.getRemiType())) {
|
|
- queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
|
|
+ queryWrapper.apply(" (b.type_id = {0} OR t.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b2.type_id = {0} OR t2.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b4.type_id = {0} OR t4.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
|
|
+ queryWrapper.or().apply(" (b5.type_id = {0} OR t5.name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
|
|
}
|
|
}
|
|
// 报销金额
|
|
// 报销金额
|
|
if (dto.getAmounts() != null) {
|
|
if (dto.getAmounts() != null) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
|
|
- queryWrapper.ge("b.number", dto.getAmounts()[0]);
|
|
|
|
|
|
+ queryWrapper.and(w ->
|
|
|
|
+ w.ge("b.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b2.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b4.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ .or().ge("b5.number", Double.parseDouble(dto.getAmounts()[0]))
|
|
|
|
+ );
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
|
|
if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
|
|
- queryWrapper.le("b.number", dto.getAmounts()[1]);
|
|
|
|
|
|
+ queryWrapper.and(w ->
|
|
|
|
+ w.le("b.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b2.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b4.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ .or().le("b5.number", Double.parseDouble(dto.getAmounts()[1]))
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 报告号
|
|
// 报告号
|
|
if (StringUtils.isNotEmpty(dto.getReportNumber())) {
|
|
if (StringUtils.isNotEmpty(dto.getReportNumber())) {
|
|
queryWrapper.like("b.report_number", dto.getReportNumber());
|
|
queryWrapper.like("b.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b2.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b4.report_number", dto.getReportNumber());
|
|
|
|
+ queryWrapper.or().like("b5.report_number", dto.getReportNumber());
|
|
|
|
+ }
|
|
|
|
+ // 报销类型
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceType())) {
|
|
|
|
+ queryWrapper.eq("a.source_type", dto.getSourceType());
|
|
}
|
|
}
|
|
List<RetureListDto> exportList = infoMapper.findExportList(queryWrapper);
|
|
List<RetureListDto> exportList = infoMapper.findExportList(queryWrapper);
|
|
if (CollectionUtils.isNotEmpty(exportList)) {
|
|
if (CollectionUtils.isNotEmpty(exportList)) {
|
|
@@ -508,6 +650,13 @@ public class ReimbursementInfoService {
|
|
if ("5".equals(retureListDto.getType())) {
|
|
if ("5".equals(retureListDto.getType())) {
|
|
retureListDto.setType("已完成");
|
|
retureListDto.setType("已完成");
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isNotBlank(retureListDto.getSourceType())) {
|
|
|
|
+ if ("2".equals(retureListDto.getSourceType())) {
|
|
|
|
+ retureListDto.setContractName(retureListDto.getProjectName());
|
|
|
|
+ retureListDto.setProjectName("");
|
|
|
|
+ }
|
|
|
|
+ retureListDto.setSourceType(DictUtils.getDictLabel(retureListDto.getSourceType(),"pg_reimbursement_source_type",""));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return exportList;
|
|
return exportList;
|