|
@@ -21,6 +21,7 @@ import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springblade.resource.entity.Attach;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -46,14 +47,14 @@ public class EMFinancialReimbursementServiceImpl extends BaseServiceImpl<ExMFina
|
|
|
public IPage<EMFinancialReimbursementInfoVO> financialPage(IPage<EMFinancialReimbursementInfo> page, EMFinancialReimbursementInfoDTO dto) {
|
|
|
QueryWrapper<EMFinancialReimbursementInfo> queryWrapper = Condition.getQueryWrapper(dto);
|
|
|
queryWrapper.lambda().eq(EMFinancialReimbursementInfo::getIsTemp, 1); //提交的数据
|
|
|
- IPage<EMFinancialReimbursementInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, true, EMFinancialReimbursementInfo::getCreateTime));
|
|
|
+ IPage<EMFinancialReimbursementInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, false, EMFinancialReimbursementInfo::getCreateTime));
|
|
|
List<DictInfo> dictInfoList = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'expense_fr_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
Map<Long, String> userMap = iUserClient.selectUserAll().stream().filter(f -> ObjectUtil.isNotEmpty(f.getRealName())).collect(Collectors.toMap(User::getId, User::getRealName));
|
|
|
List<ControlProjectInfo> controlProjectInfos = projectInfoServiceImpl.getBaseMapper().selectList(Wrappers.<ControlProjectInfo>lambdaQuery().select(ControlProjectInfo::getId, ControlProjectInfo::getName));
|
|
|
return pages.convert(reimbursementInfo -> {
|
|
|
EMFinancialReimbursementInfoVO vo = new EMFinancialReimbursementInfoVO();
|
|
|
BeanUtils.copyProperties(reimbursementInfo, vo);
|
|
|
- vo.setUserNameVesting(userMap.get(vo.getCreateUser()));
|
|
|
+ vo.setUserNameVesting(userMap.get(vo.getUserIdVesting()));
|
|
|
vo.setCreateName(userMap.get(vo.getCreateUser()));
|
|
|
vo.setApprovalStatusName(vo.getStatus().equals(1) ? "待审批" : (vo.getStatus().equals(2) ? "已审批" : (vo.getStatus().equals(3) ? "已驳回" : "未上报")));
|
|
|
vo.setApprovalResultName(vo.getApprovalStatusName().equals("已审批") || vo.getApprovalStatusName().equals("已驳回") ? "已通过" : "未通过");
|
|
@@ -116,9 +117,21 @@ public class EMFinancialReimbursementServiceImpl extends BaseServiceImpl<ExMFina
|
|
|
@Override
|
|
|
public EMFinancialReimbursementInfoVO financialDetail(Long id) {
|
|
|
EMFinancialReimbursementInfo obj = baseMapper.selectById(id);
|
|
|
- EMFinancialReimbursementInfoVO vo = BeanUtil.copyProperties(obj, EMFinancialReimbursementInfoVO.class);
|
|
|
- //TODO vo.set
|
|
|
- return vo;
|
|
|
+ if (ObjectUtil.isNotEmpty(obj)) {
|
|
|
+ EMFinancialReimbursementInfoVO vo = BeanUtil.copyProperties(obj, EMFinancialReimbursementInfoVO.class);
|
|
|
+ if (vo != null) {
|
|
|
+ Attach file1 = jdbcTemplate.query("select original_name from blade_attach where link = '" + obj.getFrAttachmentUrl() + "'", new BeanPropertyRowMapper<>(Attach.class)).stream().findAny().orElse(null);
|
|
|
+ if (file1 != null) {
|
|
|
+ vo.setFrAttachmentUrlName(file1.getOriginalName());
|
|
|
+ }
|
|
|
+ Attach file2 = jdbcTemplate.query("select original_name from blade_attach where link = '" + obj.getFrElectronicInvoiceUrl() + "'", new BeanPropertyRowMapper<>(Attach.class)).stream().findAny().orElse(null);
|
|
|
+ if (file2 != null) {
|
|
|
+ vo.setFrElectronicInvoiceUrlName(file2.getOriginalName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -252,6 +265,20 @@ public class EMFinancialReimbursementServiceImpl extends BaseServiceImpl<ExMFina
|
|
|
public List<EMFinancialReimbursementInfoVO> financialDraftDetail(String eMDraftIds) {
|
|
|
List<EMFinancialReimbursementInfo> emFinancialReimbursementInfos = baseMapper.selectBatchIds(Func.toStrList(eMDraftIds));
|
|
|
List<EMFinancialReimbursementInfoVO> vos = BeanUtil.copyProperties(emFinancialReimbursementInfos, EMFinancialReimbursementInfoVO.class);
|
|
|
+ for (EMFinancialReimbursementInfoVO vo : vos) {
|
|
|
+ if (ObjectUtil.isNotEmpty(vo.getFrAttachmentUrl())) {
|
|
|
+ Attach file1 = jdbcTemplate.query("select original_name from blade_attach where link = '" + vo.getFrAttachmentUrl() + "'", new BeanPropertyRowMapper<>(Attach.class)).stream().findAny().orElse(null);
|
|
|
+ if (file1 != null) {
|
|
|
+ vo.setFrAttachmentUrlName(file1.getOriginalName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(vo.getFrElectronicInvoiceUrl())) {
|
|
|
+ Attach file2 = jdbcTemplate.query("select original_name from blade_attach where link = '" + vo.getFrElectronicInvoiceUrl() + "'", new BeanPropertyRowMapper<>(Attach.class)).stream().findAny().orElse(null);
|
|
|
+ if (file2 != null) {
|
|
|
+ vo.setFrElectronicInvoiceUrlName(file2.getOriginalName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return vos;
|
|
|
}
|
|
|
|