|
@@ -118,7 +118,7 @@ public class CwReimbursementInfoService {
|
|
}
|
|
}
|
|
// 报销时间
|
|
// 报销时间
|
|
if (dto.getDates() != null) {
|
|
if (dto.getDates() != null) {
|
|
- queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
|
|
|
|
|
|
+ queryWrapper.between("a.approval_time", dto.getDates()[0], dto.getDates()[1]);
|
|
}
|
|
}
|
|
// 经办人
|
|
// 经办人
|
|
if (StringUtils.isNotEmpty(dto.getHandled())) {
|
|
if (StringUtils.isNotEmpty(dto.getHandled())) {
|
|
@@ -312,6 +312,9 @@ public class CwReimbursementInfoService {
|
|
info.setUpdateById(userDTO.getId());
|
|
info.setUpdateById(userDTO.getId());
|
|
info.setUpdateTime(new Date());
|
|
info.setUpdateTime(new Date());
|
|
info.setDelFlag(0);
|
|
info.setDelFlag(0);
|
|
|
|
+ if ("2".equals(dto.getType())){
|
|
|
|
+ info.setApprovalTime(new Date());
|
|
|
|
+ }
|
|
infoMapper.insert(info);
|
|
infoMapper.insert(info);
|
|
// 保存项目详情列表信息
|
|
// 保存项目详情列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
@@ -319,30 +322,7 @@ public class CwReimbursementInfoService {
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
detailInfo.setInfoId(id);
|
|
detailInfo.setInfoId(id);
|
|
detailInfoMapper.insert(detailInfo);
|
|
detailInfoMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 保存合同详情列表信息
|
|
// 保存合同详情列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
@@ -358,29 +338,6 @@ public class CwReimbursementInfoService {
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
detailInfo.setInfoId(id);
|
|
detailInfo.setInfoId(id);
|
|
cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -390,29 +347,6 @@ public class CwReimbursementInfoService {
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
detailInfo.setInfoId(id);
|
|
detailInfo.setInfoId(id);
|
|
cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -434,53 +368,63 @@ public class CwReimbursementInfoService {
|
|
humanReimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
humanReimbursementDetailInfoProcuredMapper.insert(detailInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 保存专用发票列表信息
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
- for (CwReimbursementAmountInfo 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);
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
+ if("0".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存专用发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
+ for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+ }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存电子发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
+ for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+
|
|
|
|
+ // 保存电子发票附件列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
+ infoService.saveFiles(dto.getInvoiceReimbursementFiles(), userDTO, id,"invoiceReimbursement");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
-// if("0".equals(dto.getReimbursementType())){
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// //清除电子发票信息
|
|
|
|
-// // 删除合同列表
|
|
|
|
-// LambdaQueryWrapper<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
-// deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
-// deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
-// amountInfoMapper.delete(deleteInfo);
|
|
|
|
-// }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
-// // 保存电子发票列表信息
|
|
|
|
-//
|
|
|
|
-// //清除专用发票信息
|
|
|
|
-// LambdaQueryWrapper<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
-// deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
-// deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
-// amountInfoMapper.delete(deleteInfo);
|
|
|
|
-//
|
|
|
|
-// // 保存电子发票附件列表信息
|
|
|
|
-// if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
-// infoService.saveFiles(dto.getInvoiceReimbursementFiles(), userDTO, id,"invoiceReimbursement");
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- // 保存电子发票附件列表信息
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
- infoService.saveFiles(dto.getInvoiceReimbursementFiles(), userDTO, id,"invoiceReimbursement");
|
|
|
|
- }
|
|
|
|
// 保存附件列表信息
|
|
// 保存附件列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
infoService.saveFiles(dto.getFiles(), userDTO, id);
|
|
infoService.saveFiles(dto.getFiles(), userDTO, id);
|
|
@@ -494,6 +438,13 @@ public class CwReimbursementInfoService {
|
|
BeanUtils.copyProperties(dto, info);
|
|
BeanUtils.copyProperties(dto, info);
|
|
info.setUpdateById(userDTO.getId());
|
|
info.setUpdateById(userDTO.getId());
|
|
info.setUpdateTime(new Date());
|
|
info.setUpdateTime(new Date());
|
|
|
|
+ //根据id查询申请日期是否存在
|
|
|
|
+ CwReimbursementInfo cwReimbursementInfo = infoMapper.selectById(dto.getId());
|
|
|
|
+ if ("2".equals(dto.getType())){
|
|
|
|
+ if (ObjectUtil.isEmpty(cwReimbursementInfo.getApprovalTime())){
|
|
|
|
+ info.setApprovalTime(new Date());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
infoMapper.updateById(info);
|
|
infoMapper.updateById(info);
|
|
// 修改报销详情列表信息
|
|
// 修改报销详情列表信息
|
|
// 删除原有数据
|
|
// 删除原有数据
|
|
@@ -522,11 +473,7 @@ public class CwReimbursementInfoService {
|
|
humanDetailWrapperProcured.eq(HumanReimbursementDetailInfoProcured::getInfoId, dto.getId());
|
|
humanDetailWrapperProcured.eq(HumanReimbursementDetailInfoProcured::getInfoId, dto.getId());
|
|
humanReimbursementDetailInfoProcuredMapper.delete(humanDetailWrapperProcured);
|
|
humanReimbursementDetailInfoProcuredMapper.delete(humanDetailWrapperProcured);
|
|
|
|
|
|
- // 修改专用发票信息列表
|
|
|
|
- // 删除原有数据
|
|
|
|
- LambdaQueryWrapper<CwReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- amountWrapper.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
- amountInfoMapper.delete(amountWrapper);
|
|
|
|
|
|
+
|
|
|
|
|
|
// 保存项目详情列表信息
|
|
// 保存项目详情列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
@@ -535,29 +482,6 @@ public class CwReimbursementInfoService {
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setId("");
|
|
detailInfo.setId("");
|
|
detailInfoMapper.insert(detailInfo);
|
|
detailInfoMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -577,29 +501,6 @@ public class CwReimbursementInfoService {
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setId("");
|
|
detailInfo.setId("");
|
|
cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -610,29 +511,6 @@ public class CwReimbursementInfoService {
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setInfoId(dto.getId());
|
|
detailInfo.setId("");
|
|
detailInfo.setId("");
|
|
cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
- //保存数电发票信息
|
|
|
|
- if (StringUtils.isNotBlank(detailInfo.getReimbursementType())&&"1".equals(detailInfo.getReimbursementType())&& StringUtils.isNotBlank(detailInfo.getFileName())){
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
- for (CwReimbursementAmountInfo amountInfo : dto.getInvoiceReimbursements()) {
|
|
|
|
- if (amountInfo.getNumber().equals(detailInfo.getInvoiceNumber())){
|
|
|
|
- //电子发票报销 发票信息
|
|
|
|
- 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);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -656,80 +534,68 @@ public class CwReimbursementInfoService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // 保存专用发票列表信息
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
- for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ amountWrapper.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ amountInfoMapper.delete(amountWrapper);
|
|
|
|
+ if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
+ if("0".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存专用发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
+ for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+ }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
+ // 保存电子发票列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
+ for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
+ deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
+ deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
+ amountInfoMapper.delete(deleteInfo);
|
|
|
|
+
|
|
|
|
+ // 保存电子发票附件列表信息
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
+ infoService.updateFiles(dto.getInvoiceReimbursementFiles(), userDTO, dto.getId(),"invoiceReimbursement");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// if(StringUtils.isNotBlank(dto.getReimbursementType())){
|
|
|
|
-// if("0".equals(dto.getReimbursementType())){
|
|
|
|
-//
|
|
|
|
-// //清除电子发票信息
|
|
|
|
-// // 删除合同列表
|
|
|
|
-// LambdaQueryWrapper<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
-// deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
-// deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "0");
|
|
|
|
-// amountInfoMapper.delete(deleteInfo);
|
|
|
|
-// }else if("1".equals(dto.getReimbursementType())){
|
|
|
|
-// // 保存电子发票列表信息
|
|
|
|
-// if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursements())) {
|
|
|
|
-// for (CwReimbursementAmountInfo 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<CwReimbursementAmountInfo> deleteInfo = new LambdaQueryWrapper<>();
|
|
|
|
-// deleteInfo.eq(CwReimbursementAmountInfo::getInfoId, dto.getId());
|
|
|
|
-// deleteInfo.ne(CwReimbursementAmountInfo::getReimbursementType, "1");
|
|
|
|
-// amountInfoMapper.delete(deleteInfo);
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- // 保存电子发票附件列表信息
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getInvoiceReimbursementFiles())) {
|
|
|
|
- infoService.updateFiles(dto.getInvoiceReimbursementFiles(), userDTO, dto.getId(),"invoiceReimbursement");
|
|
|
|
- }
|
|
|
|
- /*if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
|
- for (CwReimbursementAmountInfo 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(dto.getId());
|
|
|
|
- amountInfoMapper.insert(amountInfo);
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
// 修改附件信息列表
|
|
// 修改附件信息列表
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
infoService.updateFiles(dto.getFiles(), userDTO, dto.getId(),"cwWorkContract");
|
|
infoService.updateFiles(dto.getFiles(), userDTO, dto.getId(),"cwWorkContract");
|