diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java index b759dcb0..1e98c5b3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyService.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.bs.controller.admin.expenseapply.vo.ExpenseApplyE import cn.iocoder.yudao.module.bs.controller.admin.expenseapply.vo.ExpenseApplyPageReqVO; import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapply.ExpenseApplyDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.github.yulichang.base.MPJBaseService; import javax.validation.Valid; import java.util.ArrayList; @@ -18,7 +19,7 @@ import java.util.List; * * @author 芋道源码 */ -public interface ExpenseApplyService extends IService { +public interface ExpenseApplyService extends MPJBaseService { /** * 创建申请单 diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java index 186e795d..143487a4 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseapply/ExpenseApplyServiceImpl.java @@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.bpm.service.expenseapply; import cn.hutool.core.collection.CollUtil; 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.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; 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.util.MyBatisUtils; 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.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.user.AdminUserApi; 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.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; @@ -49,7 +53,7 @@ import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.EXPENSE_APPLY_ @Service @Validated @Transactional(rollbackFor = Exception.class) -public class ExpenseApplyServiceImpl extends ServiceImpl implements ExpenseApplyService { +public class ExpenseApplyServiceImpl extends MPJBaseServiceImpl implements ExpenseApplyService { public static final String PROCESS_KEY = "expense_apply"; @Resource @@ -174,8 +178,24 @@ public class ExpenseApplyServiceImpl extends ServiceImpl getExpenseApplyPage(ExpenseApplyPageReqVO pageReqVO) { - return expenseApplyMapper.selectPage(pageReqVO); + public PageResult getExpenseApplyPage(ExpenseApplyPageReqVO reqVO) { + MPJLambdaWrapper 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 mpPage = MyBatisUtils.buildPage(reqVO); + selectJoinListPage(mpPage, ExpenseApplyDO.class, wrapper.distinct()); + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); +// return expenseApplyMapper.selectPage(pageReqVO); } @Override