|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.*;
|
|
import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
@@ -32,10 +33,6 @@ import com.jeeplus.assess.program.configuration.projectList.mapper.ProgramReport
|
|
import com.jeeplus.assess.program.configuration.projectList.mapper.ProjectListMapper;
|
|
import com.jeeplus.assess.program.configuration.projectList.mapper.ProjectListMapper;
|
|
import com.jeeplus.assess.reimbursement.reimbursementInfo.domain.*;
|
|
import com.jeeplus.assess.reimbursement.reimbursementInfo.domain.*;
|
|
import com.jeeplus.assess.reimbursement.reimbursementInfo.mapper.*;
|
|
import com.jeeplus.assess.reimbursement.reimbursementInfo.mapper.*;
|
|
-import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.QueryListDto;
|
|
|
|
-import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.RetureListDto;
|
|
|
|
-import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.SaveInfoDto;
|
|
|
|
-import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
|
|
|
|
import com.jeeplus.assess.workContract.service.WorkContractService;
|
|
import com.jeeplus.assess.workContract.service.WorkContractService;
|
|
import com.jeeplus.assess.workContract.service.dto.WorkContractInfoDto;
|
|
import com.jeeplus.assess.workContract.service.dto.WorkContractInfoDto;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -130,6 +127,10 @@ public class ReimbursementInfoService {
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
if (StringUtils.isNotEmpty(dto.getType())) {
|
|
queryWrapper.eq("a.type", dto.getType());
|
|
queryWrapper.eq("a.type", dto.getType());
|
|
}
|
|
}
|
|
|
|
+ // 报销项状态
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getReimbursementType())) {
|
|
|
|
+ queryWrapper.eq("a.reimbursement_type", dto.getReimbursementType());
|
|
|
|
+ }
|
|
// 报销部门
|
|
// 报销部门
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
if (StringUtils.isNotEmpty(dto.getDepartment())) {
|
|
queryWrapper.apply("(( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
queryWrapper.apply("(( b.dept_id = {0} OR so.name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
|
|
@@ -322,20 +323,61 @@ public class ReimbursementInfoService {
|
|
reimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
reimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 保存专用发票列表信息
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
- for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
|
|
- // 生成id
|
|
|
|
- String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
- amountInfo.setId(amountId);
|
|
|
|
- amountInfo.setCreateById(userDTO.getId());
|
|
|
|
- amountInfo.setCreateTime(new Date());
|
|
|
|
- amountInfo.setUpdateById(userDTO.getId());
|
|
|
|
- amountInfo.setUpdateTime(new Date());
|
|
|
|
- amountInfo.setDelFlag(0);
|
|
|
|
- // 保存基础表信息主键值
|
|
|
|
- amountInfo.setInfoId(id);
|
|
|
|
- amountInfoMapper.insert(amountInfo);
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
+ if("0".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存专用发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
+ for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
|
|
+ //普通报销 发票信息
|
|
|
|
+ amountInfo.setReimbursementType("0");
|
|
|
|
+ // 生成id
|
|
|
|
+ String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ amountInfo.setId(amountId);
|
|
|
|
+ amountInfo.setCreateById(userDTO.getId());
|
|
|
|
+ amountInfo.setCreateTime(new Date());
|
|
|
|
+ amountInfo.setUpdateById(userDTO.getId());
|
|
|
|
+ amountInfo.setUpdateTime(new Date());
|
|
|
|
+ amountInfo.setDelFlag(0);
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ amountInfo.setInfoId(id);
|
|
|
|
+ amountInfoMapper.insert(amountInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //清除电子发票信息
|
|
|
|
+ // 删除合同列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(ReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+ }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存电子发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
+ for (ReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
+ //电子发票报销 发票信息
|
|
|
|
+ amountInfo.setReimbursementType("1");
|
|
|
|
+ // 生成id
|
|
|
|
+ String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ amountInfo.setId(amountId);
|
|
|
|
+ amountInfo.setCreateById(userDTO.getId());
|
|
|
|
+ amountInfo.setCreateTime(new Date());
|
|
|
|
+ amountInfo.setUpdateById(userDTO.getId());
|
|
|
|
+ amountInfo.setUpdateTime(new Date());
|
|
|
|
+ amountInfo.setDelFlag(0);
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ amountInfo.setInfoId(id);
|
|
|
|
+ amountInfoMapper.insert(amountInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //清除专用发票信息
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(ReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+
|
|
|
|
+ // 保存电子发票附件列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
+ workContractService.saveFiles(dto.getInvoiceReimbursementFiles(), userDTO, id,"invoiceReimbursement");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 保存附件列表信息
|
|
// 保存附件列表信息
|
|
@@ -426,7 +468,66 @@ public class ReimbursementInfoService {
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
amountWrapper.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
amountWrapper.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
amountInfoMapper.delete(amountWrapper);
|
|
amountInfoMapper.delete(amountWrapper);
|
|
- if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
+ if("0".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存专用发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
+ for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
|
|
+ //普通报销 发票信息
|
|
|
|
+ amountInfo.setReimbursementType("0");
|
|
|
|
+ // 生成id
|
|
|
|
+ String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ amountInfo.setId(amountId);
|
|
|
|
+ amountInfo.setCreateById(userDTO.getId());
|
|
|
|
+ amountInfo.setCreateTime(new Date());
|
|
|
|
+ amountInfo.setUpdateById(userDTO.getId());
|
|
|
|
+ amountInfo.setUpdateTime(new Date());
|
|
|
|
+ amountInfo.setDelFlag(0);
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ amountInfo.setInfoId(dto.getId());
|
|
|
|
+ amountInfoMapper.insert(amountInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //清除电子发票信息
|
|
|
|
+ // 删除合同列表
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(ReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+ }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存电子发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
+ for (ReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
+ //电子发票报销 发票信息
|
|
|
|
+ amountInfo.setReimbursementType("1");
|
|
|
|
+ // 生成id
|
|
|
|
+ String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ amountInfo.setId(amountId);
|
|
|
|
+ amountInfo.setCreateById(userDTO.getId());
|
|
|
|
+ amountInfo.setCreateTime(new Date());
|
|
|
|
+ amountInfo.setUpdateById(userDTO.getId());
|
|
|
|
+ amountInfo.setUpdateTime(new Date());
|
|
|
|
+ amountInfo.setDelFlag(0);
|
|
|
|
+ // 保存基础表信息主键值
|
|
|
|
+ amountInfo.setInfoId(dto.getId());
|
|
|
|
+ amountInfoMapper.insert(amountInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //清除专用发票信息
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(ReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(ReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 保存电子发票附件列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
+ workContractService.updateFiles(dto.getInvoiceReimbursementFiles(), userDTO, dto.getId(),"invoiceReimbursement");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
for (ReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
// 生成id
|
|
// 生成id
|
|
String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
String amountId = UUID.randomUUID().toString().replace("-", "");
|
|
@@ -440,7 +541,7 @@ public class ReimbursementInfoService {
|
|
amountInfo.setInfoId(dto.getId());
|
|
amountInfo.setInfoId(dto.getId());
|
|
amountInfoMapper.insert(amountInfo);
|
|
amountInfoMapper.insert(amountInfo);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
// 修改附件信息列表
|
|
// 修改附件信息列表
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
workContractService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
workContractService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
@@ -513,16 +614,31 @@ public class ReimbursementInfoService {
|
|
// 查询专用发票信息列表
|
|
// 查询专用发票信息列表
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
|
|
+ amountInfoLambdaQueryWrapper.eq(ReimbursementAmountInfo::getReimbursementType, "0");
|
|
List<ReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
List<ReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
dto.setAmountInfos(amountInfos);
|
|
dto.setAmountInfos(amountInfos);
|
|
|
|
+ LambdaQueryWrapper<ReimbursementAmountInfo> invoiceReimbursementsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ invoiceReimbursementsLambdaQueryWrapper.eq(ReimbursementAmountInfo::getInfoId, id);
|
|
|
|
+ invoiceReimbursementsLambdaQueryWrapper.eq(ReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
+ List<ReimbursementAmountInfo> invoiceReimbursements = amountInfoMapper.selectList(invoiceReimbursementsLambdaQueryWrapper);
|
|
|
|
+ dto.setInvoiceReimbursements(invoiceReimbursements);
|
|
// 查询附件信息
|
|
// 查询附件信息
|
|
- List<WorkAttachmentInfo> files = infoMapper.findFiles(id);
|
|
|
|
- if (CollectionUtils.isNotEmpty(files)) {
|
|
|
|
- for (WorkAttachmentInfo i : files) {
|
|
|
|
|
|
+ List<WorkAttachmentInfo> fileList = infoMapper.findFiles(id);
|
|
|
|
+ List<WorkAttachmentInfo> files = Lists.newArrayList();
|
|
|
|
+ List<WorkAttachmentInfo> invoiceReimbursementFiles = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isNotEmpty(fileList)) {
|
|
|
|
+ for (WorkAttachmentInfo i : fileList) {
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
|
+ if("invoiceReimbursement".equals(i.getAttachmentFlag())){
|
|
|
|
+ invoiceReimbursementFiles.add(i);
|
|
|
|
+ }else{
|
|
|
|
+ files.add(i);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
dto.setFiles(files);
|
|
dto.setFiles(files);
|
|
|
|
+ dto.setInvoiceReimbursementFiles(invoiceReimbursementFiles);
|
|
}
|
|
}
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
@@ -877,4 +993,21 @@ public class ReimbursementInfoService {
|
|
|
|
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据发票号查询是否已经或正在报销
|
|
|
|
+ * @param invoiceNumber
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Integer getEffectiveDataByInvoiceNumber(String invoiceNumber,String id){
|
|
|
|
+ return infoMapper.getEffectiveDataByInvoiceNumber(invoiceNumber,id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<ReimbursementAmountInfoDTO> getInvoiceReimbursementAmountList(List<String> idList) {
|
|
|
|
+ List<ReimbursementAmountInfoDTO> list = infoMapper.getInvoiceReimbursementAmountList(idList);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|