|
@@ -10,12 +10,8 @@ import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
import com.jeeplus.test.cw.contractRegistration.service.ContractInfoService;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementAmountInfo;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementDetailInfo;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.CwReimbursementInfo;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.CwReimbursementAmountInfoMapper;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.CwReimbursementDetailInfoMapper;
|
|
|
-import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.CwReimbursementInfoMapper;
|
|
|
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.domain.*;
|
|
|
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.mapper.*;
|
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.*;
|
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
@@ -42,6 +38,15 @@ public class CwReimbursementInfoService {
|
|
|
private CwReimbursementInfoMapper infoMapper;
|
|
|
|
|
|
@Resource
|
|
|
+ private CwReimbursementDetailInfoContractMapper cwReimbursementDetailInfoContractMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CwReimbursementDetailInfoReportMapper cwReimbursementDetailInfoReportMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CwReimbursementDetailInfoOtherMapper cwReimbursementDetailInfoOtherMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private CwReimbursementDetailInfoMapper detailInfoMapper;
|
|
|
|
|
|
@Resource
|
|
@@ -67,7 +72,7 @@ public class CwReimbursementInfoService {
|
|
|
* c表是sysUser
|
|
|
*/
|
|
|
queryWrapper.eq("a.del_flag", 0);
|
|
|
- queryWrapper.eq("c.project_name", dto.getProjectName());
|
|
|
+ queryWrapper.eq("c.id", dto.getProjectId());
|
|
|
return infoMapper.getReportNoList(page, queryWrapper);
|
|
|
}
|
|
|
|
|
@@ -123,6 +128,9 @@ public class CwReimbursementInfoService {
|
|
|
if (StringUtils.isNotEmpty(dto.getReportNumber())) {
|
|
|
queryWrapper.like("b.report_number", dto.getReportNumber());
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceType())) {
|
|
|
+ queryWrapper.eq("a.source_type", dto.getSourceType());
|
|
|
+ }
|
|
|
return infoMapper.findList(page, queryWrapper);
|
|
|
}
|
|
|
|
|
@@ -172,22 +180,38 @@ public class CwReimbursementInfoService {
|
|
|
info.setUpdateDate(new Date());
|
|
|
info.setDelFlag(0);
|
|
|
infoMapper.insert(info);
|
|
|
- // 保存详情列表信息
|
|
|
+ // 保存项目详情列表信息
|
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
|
for (CwReimbursementDetailInfo 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);
|
|
|
detailInfoMapper.insert(detailInfo);
|
|
|
}
|
|
|
}
|
|
|
+ // 保存合同详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
|
+ for (CwReimbursementDetailInfoContract detailInfo : dto.getDetailInfoContracts()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
+ cwReimbursementDetailInfoContractMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 保存报告详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoReports())) {
|
|
|
+ for (CwReimbursementDetailInfoReport detailInfo : dto.getDetailInfoReports()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
+ cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 保存其他报销详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoOthers())) {
|
|
|
+ for (CwReimbursementDetailInfoOther detailInfo : dto.getDetailInfoOthers()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(id);
|
|
|
+ cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 保存专用发票列表信息
|
|
|
if (CollectionUtils.isNotEmpty(dto.getAmountInfos())) {
|
|
|
for (CwReimbursementAmountInfo amountInfo : dto.getAmountInfos()) {
|
|
@@ -223,21 +247,55 @@ public class CwReimbursementInfoService {
|
|
|
LambdaQueryWrapper<CwReimbursementDetailInfo> detailWrapper = new LambdaQueryWrapper<>();
|
|
|
detailWrapper.eq(CwReimbursementDetailInfo::getInfoId, dto.getId());
|
|
|
detailInfoMapper.delete(detailWrapper);
|
|
|
+ // 删除合同列表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoContract> detailWrapperContract = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperContract.eq(CwReimbursementDetailInfoContract::getInfoId, dto.getId());
|
|
|
+ cwReimbursementDetailInfoContractMapper.delete(detailWrapperContract);
|
|
|
+ // 删除报告列表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoReport> detailWrapperReport = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperReport.eq(CwReimbursementDetailInfoReport::getInfoId, dto.getId());
|
|
|
+ cwReimbursementDetailInfoReportMapper.delete(detailWrapperReport);
|
|
|
+ // 删除其他报销表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoOther> detailWrapperOthers = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperOthers.eq(CwReimbursementDetailInfoOther::getInfoId, dto.getId());
|
|
|
+ cwReimbursementDetailInfoOtherMapper.delete(detailWrapperOthers);
|
|
|
+
|
|
|
+ // 保存项目详情列表信息
|
|
|
if (CollectionUtils.isNotEmpty(dto.getDetailInfos())) {
|
|
|
for (CwReimbursementDetailInfo 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.setId("");
|
|
|
detailInfoMapper.insert(detailInfo);
|
|
|
}
|
|
|
}
|
|
|
+ // 保存合同详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoContracts())) {
|
|
|
+ for (CwReimbursementDetailInfoContract detailInfo : dto.getDetailInfoContracts()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
+ detailInfo.setId("");
|
|
|
+ cwReimbursementDetailInfoContractMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 保存报告详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoReports())) {
|
|
|
+ for (CwReimbursementDetailInfoReport detailInfo : dto.getDetailInfoReports()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
+ detailInfo.setId("");
|
|
|
+ cwReimbursementDetailInfoReportMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 保存其他报销详情列表信息
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getDetailInfoOthers())) {
|
|
|
+ for (CwReimbursementDetailInfoOther detailInfo : dto.getDetailInfoOthers()) {
|
|
|
+ // 保存基础表信息主键值
|
|
|
+ detailInfo.setInfoId(dto.getId());
|
|
|
+ detailInfo.setId("");
|
|
|
+ cwReimbursementDetailInfoOtherMapper.insert(detailInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 修改专用发票信息列表
|
|
|
// 删除原有数据
|
|
|
LambdaQueryWrapper<CwReimbursementAmountInfo> amountWrapper = new LambdaQueryWrapper<>();
|
|
@@ -269,9 +327,21 @@ public class CwReimbursementInfoService {
|
|
|
// 删除基础信息表
|
|
|
infoMapper.deleteById(id);
|
|
|
// 删除详情列表
|
|
|
- LambdaQueryWrapper<CwReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- detailInfoLambdaQueryWrapper.eq(CwReimbursementDetailInfo::getInfoId, id);
|
|
|
- detailInfoMapper.delete(detailInfoLambdaQueryWrapper);
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfo> detailWrapper = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapper.eq(CwReimbursementDetailInfo::getInfoId, id);
|
|
|
+ detailInfoMapper.delete(detailWrapper);
|
|
|
+ // 删除合同列表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoContract> detailWrapperContract = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperContract.eq(CwReimbursementDetailInfoContract::getInfoId, id);
|
|
|
+ cwReimbursementDetailInfoContractMapper.delete(detailWrapperContract);
|
|
|
+ // 删除报告列表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoReport> detailWrapperReport = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperReport.eq(CwReimbursementDetailInfoReport::getInfoId, id);
|
|
|
+ cwReimbursementDetailInfoReportMapper.delete(detailWrapperReport);
|
|
|
+ // 删除其他报销列表
|
|
|
+ LambdaQueryWrapper<CwReimbursementDetailInfoOther> detailWrapperOther = new LambdaQueryWrapper<>();
|
|
|
+ detailWrapperOther.eq(CwReimbursementDetailInfoOther::getInfoId, id);
|
|
|
+ cwReimbursementDetailInfoOtherMapper.delete(detailWrapperOther);
|
|
|
// 删除专用发票信息列表
|
|
|
LambdaQueryWrapper<CwReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
amountInfoLambdaQueryWrapper.eq(CwReimbursementAmountInfo::getInfoId, id);
|
|
@@ -289,12 +359,18 @@ public class CwReimbursementInfoService {
|
|
|
CwReimbursementInfo info = infoMapper.selectById(id);
|
|
|
BeanUtils.copyProperties(info, dto);
|
|
|
// 查询详情列表
|
|
|
- LambdaQueryWrapper<CwReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- detailInfoLambdaQueryWrapper.eq(CwReimbursementDetailInfo::getInfoId, id);
|
|
|
- detailInfoLambdaQueryWrapper.orderByAsc(CwReimbursementDetailInfo::getNumber);
|
|
|
- List<CwReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
|
-
|
|
|
- dto.setDetailInfos(detailInfos);
|
|
|
+// LambdaQueryWrapper<CwReimbursementDetailInfo> detailInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+// detailInfoLambdaQueryWrapper.eq(CwReimbursementDetailInfo::getInfoId, id);
|
|
|
+// detailInfoLambdaQueryWrapper.orderByAsc(CwReimbursementDetailInfo::getNumber);
|
|
|
+// List<CwReimbursementDetailInfo> detailInfos = detailInfoMapper.selectList(detailInfoLambdaQueryWrapper);
|
|
|
+ // 项目报销详情
|
|
|
+ dto.setDetailInfos(infoMapper.getDetailList(id));
|
|
|
+ // 合同报销详情
|
|
|
+ dto.setDetailInfoContracts(infoMapper.getContractDetailList(id));
|
|
|
+ // 报告报销详情
|
|
|
+ dto.setDetailInfoReports(infoMapper.getReportDetailList(id));
|
|
|
+ // 其他报销
|
|
|
+ dto.setDetailInfoOthers(infoMapper.getOtherDetailList(id));
|
|
|
// 查询专用发票信息列表
|
|
|
LambdaQueryWrapper<CwReimbursementAmountInfo> amountInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
amountInfoLambdaQueryWrapper.eq(CwReimbursementAmountInfo::getInfoId, id);
|