|
@@ -1,36 +1,36 @@
|
|
package com.jeeplus.centrecareful.approvalInfo.service;
|
|
package com.jeeplus.centrecareful.approvalInfo.service;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
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;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
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.jeeplus.finance.reimbursementApproval.approvalInfo.domain.ProgramProjectListInfo;
|
|
|
|
|
|
+import com.jeeplus.centrecareful.approvalType.service.ZsReimbursementTypeService;
|
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.centrecareful.approvalInfo.domain.*;
|
|
import com.jeeplus.centrecareful.approvalInfo.domain.*;
|
|
import com.jeeplus.centrecareful.approvalInfo.mapper.*;
|
|
import com.jeeplus.centrecareful.approvalInfo.mapper.*;
|
|
import com.jeeplus.centrecareful.approvalInfo.service.dto.*;
|
|
import com.jeeplus.centrecareful.approvalInfo.service.dto.*;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
-import com.jeeplus.finance.contractRegistration.service.ContractInfoService;
|
|
|
|
-import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
|
|
|
|
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
|
|
|
|
-import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
|
|
|
|
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
|
|
|
|
-import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
|
|
|
|
|
|
+//import com.jeeplus.finance.contractRegistration.service.ContractInfoService;
|
|
|
|
+//import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
|
|
import com.jeeplus.sys.domain.Office;
|
|
import com.jeeplus.sys.domain.Office;
|
|
-import com.jeeplus.sys.service.OfficeService;
|
|
|
|
|
|
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
|
|
+import com.jeeplus.sys.feign.IDictApi;
|
|
|
|
+import com.jeeplus.sys.feign.IOfficeApi;
|
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
|
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
|
|
|
|
+import com.jeeplus.sys.service.dto.OfficeDTO;
|
|
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.UserUtils;
|
|
|
|
|
|
+import com.jeeplus.utils.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import com.jeeplus.sys.utils.StringUtils;
|
|
|
|
import com.baomidou.mybatisplus.*;
|
|
import com.baomidou.mybatisplus.*;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
+
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: 王强
|
|
* @author: 王强
|
|
@@ -60,20 +60,23 @@ public class ZsReimbursementInfoService {
|
|
@Resource
|
|
@Resource
|
|
private ZsReimbursementAmountInfoMapper amountInfoMapper;
|
|
private ZsReimbursementAmountInfoMapper amountInfoMapper;
|
|
|
|
|
|
- @Resource
|
|
|
|
- private OssServiceMapper ossServiceMapper;
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private OssServiceMapper ossServiceMapper;
|
|
|
|
|
|
- @Resource
|
|
|
|
- private SerialnumTplService serialnumTplService;
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private SerialnumTplService serialnumTplService;
|
|
|
|
|
|
- @Resource
|
|
|
|
- private ContractInfoService infoService;
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private ContractInfoService infoService;
|
|
|
|
|
|
/* @Resource
|
|
/* @Resource
|
|
private MaterialBasicMapper materialBasicMapper;*/
|
|
private MaterialBasicMapper materialBasicMapper;*/
|
|
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private OfficeService officeService;
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
- private OfficeService officeService;
|
|
|
|
|
|
+ private ZsReimbursementTypeService typeService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 报告号查询
|
|
* 报告号查询
|
|
@@ -184,20 +187,20 @@ public class ZsReimbursementInfoService {
|
|
return infoMapper.findList(page, queryWrapper);
|
|
return infoMapper.findList(page, queryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
- public IPage<ProgramProjectListInfo> projectList(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
|
|
|
|
|
|
+ public IPage<ZSProgramProjectListInfo> projectList(Page<ZSProgramProjectListInfo> page, ZSProgramProjectListInfo info, String tabType) throws Exception{
|
|
|
|
|
|
//获取当前登录人信息
|
|
//获取当前登录人信息
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
|
|
|
|
|
- QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
|
|
|
|
|
|
+ QueryWrapper<ZSProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ZSProgramProjectListInfo.class);
|
|
wrapper.eq("a.del_flag", "0");
|
|
wrapper.eq("a.del_flag", "0");
|
|
wrapper.eq("a.tab_type", tabType);
|
|
wrapper.eq("a.tab_type", tabType);
|
|
wrapper.eq("b.office_id", userDTO.getOfficeDTO().getId());
|
|
wrapper.eq("b.office_id", userDTO.getOfficeDTO().getId());
|
|
if (info.getCreateDates() != null) {
|
|
if (info.getCreateDates() != null) {
|
|
wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
|
|
wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
|
|
}
|
|
}
|
|
- IPage<ProgramProjectListInfo> pageList = infoMapper.findProjectList(page, wrapper);
|
|
|
|
|
|
+ IPage<ZSProgramProjectListInfo> pageList = infoMapper.findProjectList(page, wrapper);
|
|
pageList.getRecords().stream().forEach(item ->{
|
|
pageList.getRecords().stream().forEach(item ->{
|
|
String isInvoice = infoMapper.selectInvoiceFlag(item.getId());
|
|
String isInvoice = infoMapper.selectInvoiceFlag(item.getId());
|
|
item.setIsInvoice(isInvoice);
|
|
item.setIsInvoice(isInvoice);
|
|
@@ -207,7 +210,7 @@ public class ZsReimbursementInfoService {
|
|
|
|
|
|
public String save(ZsSaveInfoDto dto) throws Exception{
|
|
public String save(ZsSaveInfoDto dto) throws Exception{
|
|
// 获取当前登录人信息
|
|
// 获取当前登录人信息
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
return update(dto, userDTO);
|
|
return update(dto, userDTO);
|
|
} else {
|
|
} else {
|
|
@@ -219,7 +222,7 @@ public class ZsReimbursementInfoService {
|
|
// 生成id
|
|
// 生成id
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
// 生成编号
|
|
// 生成编号
|
|
- String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ZsSaveInfoDto.BIZ_CODE);
|
|
|
|
|
|
+ String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), ZsSaveInfoDto.BIZ_CODE,TokenProvider.getCurrentToken());
|
|
// 保存基础信息表信息
|
|
// 保存基础信息表信息
|
|
ZsReimbursementInfo info = new ZsReimbursementInfo();
|
|
ZsReimbursementInfo info = new ZsReimbursementInfo();
|
|
BeanUtils.copyProperties(dto, info);
|
|
BeanUtils.copyProperties(dto, info);
|
|
@@ -289,7 +292,7 @@ public class ZsReimbursementInfoService {
|
|
}
|
|
}
|
|
// 保存附件列表信息
|
|
// 保存附件列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
- infoService.saveFiles(dto.getFiles(), userDTO, id);
|
|
|
|
|
|
+ typeService.saveFiles(dto.getFiles(), userDTO, id);
|
|
}
|
|
}
|
|
return id;
|
|
return id;
|
|
}
|
|
}
|
|
@@ -390,7 +393,7 @@ public class ZsReimbursementInfoService {
|
|
}
|
|
}
|
|
// 修改附件信息列表
|
|
// 修改附件信息列表
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
- infoService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
|
|
|
|
+ typeService.updateFiles(dto.getFiles(), userDTO, dto.getId());
|
|
}
|
|
}
|
|
return dto.getId();
|
|
return dto.getId();
|
|
}
|
|
}
|
|
@@ -423,9 +426,9 @@ public class ZsReimbursementInfoService {
|
|
amountInfoLambdaQueryWrapper.eq(ZsReimbursementAmountInfo::getInfoId, id);
|
|
amountInfoLambdaQueryWrapper.eq(ZsReimbursementAmountInfo::getInfoId, id);
|
|
amountInfoMapper.delete(amountInfoLambdaQueryWrapper);
|
|
amountInfoMapper.delete(amountInfoLambdaQueryWrapper);
|
|
// 删除附件信息
|
|
// 删除附件信息
|
|
- LambdaQueryWrapper<WorkAttachment> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
- wrapper.eq(WorkAttachment::getAttachmentId, id);
|
|
|
|
- ossServiceMapper.delete(wrapper);
|
|
|
|
|
|
+// LambdaQueryWrapper<WorkAttachmentInfo> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+// wrapper.eq(WorkAttachmentInfo::getAttachmentId, id);
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
|
|
return "操作成功";
|
|
return "操作成功";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -436,7 +439,7 @@ public class ZsReimbursementInfoService {
|
|
if (ObjectUtil.isNotEmpty(info)){
|
|
if (ObjectUtil.isNotEmpty(info)){
|
|
BeanUtils.copyProperties(info, dto);
|
|
BeanUtils.copyProperties(info, dto);
|
|
if(StringUtils.isNotBlank(info.getDepartment())) {
|
|
if(StringUtils.isNotBlank(info.getDepartment())) {
|
|
- Office byId = officeService.getById(info.getDepartment());
|
|
|
|
|
|
+ OfficeDTO byId = SpringUtil.getBean ( IOfficeApi.class ).getOfficeById(info.getDepartment());
|
|
if (ObjectUtil.isNotEmpty(byId)) {
|
|
if (ObjectUtil.isNotEmpty(byId)) {
|
|
dto.setDepartmentName(byId.getName());
|
|
dto.setDepartmentName(byId.getName());
|
|
}
|
|
}
|
|
@@ -463,10 +466,10 @@ public class ZsReimbursementInfoService {
|
|
List<ZsReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
List<ZsReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
|
|
dto.setAmountInfos(amountInfos);
|
|
dto.setAmountInfos(amountInfos);
|
|
// 查询附件信息
|
|
// 查询附件信息
|
|
- List<WorkAttachmentDto> files = infoMapper.findFiles(id);
|
|
|
|
|
|
+ List<WorkAttachmentInfo> files = infoMapper.findFiles(id);
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
- for (WorkAttachmentDto i : files) {
|
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
|
|
|
+ for (WorkAttachmentInfo i : files) {
|
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
dto.setFiles(files);
|
|
dto.setFiles(files);
|
|
@@ -619,7 +622,7 @@ public class ZsReimbursementInfoService {
|
|
retureListDto.setContractName(retureListDto.getProjectName());
|
|
retureListDto.setContractName(retureListDto.getProjectName());
|
|
retureListDto.setProjectName("");
|
|
retureListDto.setProjectName("");
|
|
}
|
|
}
|
|
- retureListDto.setSourceType(DictUtils.getDictLabel(retureListDto.getSourceType(),"cw_reimbursement_source_type",""));
|
|
|
|
|
|
+ retureListDto.setSourceType(SpringUtil.getBean ( IDictApi.class ).getDictLabel(retureListDto.getSourceType(),"cw_reimbursement_source_type",""));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|