|
@@ -9,12 +9,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.account.entity.account.dto.AccountRequestFundsDto;
|
|
|
import com.fjhx.account.entity.account.dto.AccountRequestFundsSelectDto;
|
|
|
-import com.fjhx.account.entity.account.po.AccountManagement;
|
|
|
import com.fjhx.account.entity.account.po.AccountRequestFunds;
|
|
|
import com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo;
|
|
|
import com.fjhx.account.entity.account.vo.AccountRequestFundsVo;
|
|
|
import com.fjhx.account.mapper.account.AccountRequestFundsMapper;
|
|
|
-import com.fjhx.account.service.account.AccountManagementService;
|
|
|
import com.fjhx.account.service.account.AccountRequestFundsDetailService;
|
|
|
import com.fjhx.account.service.account.AccountRequestFundsService;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
@@ -22,10 +20,9 @@ import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.flow.entity.flow.po.FlowExample;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
-import com.obs.services.internal.ServiceException;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
-import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -60,9 +57,6 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
@Autowired
|
|
|
private FlowExampleService flowExampleService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private AccountManagementService accountManagementService;
|
|
|
-
|
|
|
/**
|
|
|
* 查询请款列表
|
|
|
*
|
|
@@ -77,8 +71,6 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
wrapper.eq(ObjectUtil.isNotEmpty(dto.getPaymentStatus()), "ap.status", dto.getPaymentStatus());
|
|
|
wrapper.like(ObjectUtil.isNotEmpty(dto.getKeyword()), "arf.payment_remarks", dto.getKeyword());
|
|
|
wrapper.eq(ObjectUtil.isNotEmpty(dto.getWriteOffStatus()), "arf.write_off_status", dto.getWriteOffStatus());
|
|
|
- //添加权限自己看自己
|
|
|
- wrapper.eq("arf.create_user", SecurityUtils.getUserId());
|
|
|
// 请款审批状态 按 审批中、已通过、未通过 排序
|
|
|
wrapper.orderByAsc("case arf.status when 10 then 1 when 30 then 2 else 3 END");
|
|
|
// 同状态按发起时间倒序排序
|
|
@@ -140,10 +132,6 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
|
|
|
accountRequestFundsVo.setAccountRequestFundsDetailList(accountRequestFundsDetailVos);
|
|
|
|
|
|
- //赋值账户名称
|
|
|
- AccountManagement accountManagement = accountManagementService.getById(accountRequestFundsVo.getAccountManagementId());
|
|
|
- accountRequestFundsVo.setAccountManagementName(accountManagement.getName());
|
|
|
-
|
|
|
// 查询归属公司的名称
|
|
|
Corporation corporation = corporationService.getById(accountRequestFundsVo.getCorporationId());
|
|
|
if (ObjectUtil.isEmpty(corporation)) {
|
|
@@ -153,20 +141,17 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
|
|
|
// 切换数据源
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
-
|
|
|
// 查询部门名称信息
|
|
|
SysDept sysDept = sysDeptService.getById(accountRequestFundsVo.getDepartmentId());
|
|
|
if (ObjectUtil.isEmpty(sysDept)) {
|
|
|
throw new ServiceException("没有找到归属部门信息");
|
|
|
}
|
|
|
accountRequestFundsVo.setDeptName(sysDept.getDeptName());
|
|
|
-
|
|
|
// 赋值流程实例id
|
|
|
FlowExample flowExample = flowExampleService.getOne(q -> q.eq(FlowExample::getBusinessId, accountRequestFunds.getId()));
|
|
|
if (ObjectUtil.isNotEmpty(flowExample)) {
|
|
|
accountRequestFundsVo.setFlowInfoId(flowExample.getId());
|
|
|
}
|
|
|
-
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
return accountRequestFundsVo;
|