|
|
@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.bpm.service.expenseapply;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
|
|
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
|
|
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
|
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
|
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
|
|
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
|
|
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
|
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
|
@ -26,7 +28,9 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
|
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@ -49,7 +53,7 @@ import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.EXPENSE_APPLY_
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
@Validated
|
|
|
|
@Validated
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public class ExpenseApplyServiceImpl extends ServiceImpl<ExpenseApplyMapper, ExpenseApplyDO> implements ExpenseApplyService {
|
|
|
|
public class ExpenseApplyServiceImpl extends MPJBaseServiceImpl<ExpenseApplyMapper, ExpenseApplyDO> implements ExpenseApplyService {
|
|
|
|
|
|
|
|
|
|
|
|
public static final String PROCESS_KEY = "expense_apply";
|
|
|
|
public static final String PROCESS_KEY = "expense_apply";
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -174,8 +178,24 @@ public class ExpenseApplyServiceImpl extends ServiceImpl<ExpenseApplyMapper, Exp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public PageResult<ExpenseApplyDO> getExpenseApplyPage(ExpenseApplyPageReqVO pageReqVO) {
|
|
|
|
public PageResult<ExpenseApplyDO> getExpenseApplyPage(ExpenseApplyPageReqVO reqVO) {
|
|
|
|
return expenseApplyMapper.selectPage(pageReqVO);
|
|
|
|
MPJLambdaWrapper<ExpenseApplyDO> wrapper = new MPJLambdaWrapper();
|
|
|
|
|
|
|
|
wrapper.selectAll(ExpenseApplyDO.class).leftJoin(ExpenseApplyTripDO.class, ExpenseApplyTripDO::getApplyId, ExpenseApplyDO::getId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(reqVO.getBillType())) {
|
|
|
|
|
|
|
|
wrapper.eq(ExpenseApplyDO::getBillType, reqVO.getBillType());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(reqVO.getStatus())) {
|
|
|
|
|
|
|
|
wrapper.eq(ExpenseApplyDO::getStatus, reqVO.getStatus());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(reqVO.getRemark())) {
|
|
|
|
|
|
|
|
wrapper.and(w -> w.eq(ExpenseApplyTripDO::getDepartureLocation, reqVO.getRemark()).or().eq(ExpenseApplyTripDO::getDestinationLocation, reqVO.getRemark()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
IPage<ExpenseApplyDO> mpPage = MyBatisUtils.buildPage(reqVO);
|
|
|
|
|
|
|
|
selectJoinListPage(mpPage, ExpenseApplyDO.class, wrapper.distinct());
|
|
|
|
|
|
|
|
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
|
|
|
|
|
|
|
|
// return expenseApplyMapper.selectPage(pageReqVO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|