feat: 报销单

new
chenqp 1 year ago
parent d0beb88bd2
commit c2fc20dce5

@ -76,9 +76,9 @@ public class ExpenseApplyController {
queryWrapper.eq(ExpenseApplyTripDO::getApplyId, expenseApply.getId());
List<ExpenseApplyTripDO> list = expenseApplyTripService.list(queryWrapper);
expenseApply.setExpenseApplyTrips(list);
expenseApplyService.setNickNameField(CollUtil.toList(expenseApply));
expenseApplyService.setDeptNameField(CollUtil.toList(expenseApply));
}
expenseApplyService.setNickNameField(CollUtil.toList(expenseApply));
expenseApplyService.setDeptNameField(CollUtil.toList(expenseApply));
taskService.handleApprovalAuthority(CollUtil.toList(expenseApply));
return success(expenseApply);
}

@ -0,0 +1,153 @@
package cn.iocoder.yudao.module.bpm.controller.admin.expenseclaim;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.bpm.service.expenseclaim.ExpenseClaimService;
import cn.iocoder.yudao.module.bpm.service.expenseclaimdetail.ExpenseClaimDetailService;
import cn.iocoder.yudao.module.bpm.service.expenseclaimtrip.ExpenseClaimTripService;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.*;
import cn.iocoder.yudao.module.bs.convert.expenseclaim.ExpenseClaimConvert;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapply.ExpenseApplyDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO;
import cn.iocoder.yudao.module.bs.enums.BillTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Tag(name = "管理后台 - 报销单")
@RestController
@RequestMapping("/bs/expense-claim")
@Validated
public class ExpenseClaimController {
@Resource
private ExpenseClaimService expenseClaimService;
@Resource
@Lazy // 解决循环依赖
private BpmTaskService taskService;
@Resource
@Lazy
private ExpenseClaimTripService expenseClaimTripService;
@Resource
@Lazy
private ExpenseClaimDetailService expenseClaimDetailService;
@PostMapping("/create")
@Operation(summary = "创建报销单")
@PreAuthorize("@ss.hasPermission('bs:expense-claim:create')")
public CommonResult<Long> createExpenseClaim(@Valid @RequestBody ExpenseClaimCreateReqVO createReqVO) {
return expenseClaimService.createExpenseClaim(createReqVO);
}
@DeleteMapping("/delete")
@Operation(summary = "删除报销单")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('bs:expense-claim:delete')")
public CommonResult<Boolean> deleteExpenseClaim(@RequestParam("id") Long id) {
expenseClaimService.deleteExpenseClaim(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得报销单")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bs:expense-claim:query')")
public CommonResult<ExpenseClaimDO> getExpenseClaim(@RequestParam("id") Long id) {
ExpenseClaimDO expenseClaim = expenseClaimService.getExpenseClaim(id);
if (expenseClaim.getBillType().equals(BillTypeEnum.CLBX.getValue())) {
//差旅报销
//行程单
LambdaQueryWrapperX<ExpenseClaimTripDO> queryWrapper = new LambdaQueryWrapperX<>();
queryWrapper.eq(ExpenseClaimTripDO::getClaimId, expenseClaim.getId());
List<ExpenseClaimTripDO> list = expenseClaimTripService.list(queryWrapper);
expenseClaim.setExpenseClaimTrips(list);
//费用单
List<Long> tripIds = list.stream().map(ExpenseClaimTripDO::getId).collect(Collectors.toList());
LambdaQueryWrapperX<ExpenseClaimDetailDO> tripqueryWrapper = new LambdaQueryWrapperX<>();
tripqueryWrapper.in(ExpenseClaimDetailDO::getTripId, tripIds);
List<ExpenseClaimDetailDO> detailDOList = expenseClaimDetailService.list(tripqueryWrapper);
Map<Long, ExpenseClaimTripDO> tripDOMap = list.stream().collect(Collectors.toMap(ExpenseClaimTripDO::getId, eat -> eat));
for (ExpenseClaimDetailDO detailDO : detailDOList) {
ExpenseClaimTripDO tripDo = tripDOMap.get(detailDO.getTripId());
if (tripDo.getExpenseClaimDetails() == null) {
tripDo.setExpenseClaimDetails(new ArrayList<>());
}
tripDo.getExpenseClaimDetails().add(detailDO);
}
} else {
//日常报销
//费用单
LambdaQueryWrapperX<ExpenseClaimDetailDO> tripqueryWrapper = new LambdaQueryWrapperX<>();
tripqueryWrapper.eq(ExpenseClaimDetailDO::getClaimId, expenseClaim.getId());
List<ExpenseClaimDetailDO> detailDOList = expenseClaimDetailService.list(tripqueryWrapper);
expenseClaim.setExpenseClaimDetails(detailDOList);
}
expenseClaimService.setNickNameField(CollUtil.toList(expenseClaim));
expenseClaimService.setDeptNameField(CollUtil.toList(expenseClaim));
taskService.handleApprovalAuthority(CollUtil.toList(expenseClaim));
return success(expenseClaim);
}
@GetMapping("/list")
@Operation(summary = "获得报销单列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('bs:expense-claim:query')")
public CommonResult<List<ExpenseClaimRespVO>> getExpenseClaimList(@RequestParam("ids") Collection<Long> ids) {
List<ExpenseClaimDO> list = expenseClaimService.getExpenseClaimList(ids);
return success(ExpenseClaimConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得报销单分页")
@PreAuthorize("@ss.hasPermission('bs:expense-claim:query')")
public CommonResult<PageResult<ExpenseClaimDO>> getExpenseClaimPage(@Valid ExpenseClaimPageReqVO pageVO) {
PageResult<ExpenseClaimDO> pageResult = expenseClaimService.getExpenseClaimPage(pageVO);
List<ExpenseClaimDO> list = pageResult.getList();
if (CollUtil.isNotEmpty(list)) {
expenseClaimService.setNickNameField(list);
taskService.handleApprovalAuthority(list);
}
return success(pageResult);
}
@GetMapping("/export-excel")
@Operation(summary = "导出报销单 Excel")
@PreAuthorize("@ss.hasPermission('bs:expense-claim:export')")
@OperateLog(type = EXPORT)
public void exportExpenseClaimExcel(@Valid ExpenseClaimExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ExpenseClaimDO> list = expenseClaimService.getExpenseClaimList(exportReqVO);
// 导出 Excel
List<ExpenseClaimExcelVO> datas = ExpenseClaimConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "报销单.xls", "数据", ExpenseClaimExcelVO.class, datas);
}
}

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaim;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimCreateReqVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimExportReqVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimPageReqVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimUpdateReqVO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO;
import com.github.yulichang.base.MPJBaseService;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author
*/
public interface ExpenseClaimService extends MPJBaseService<ExpenseClaimDO> {
/**
*
*
* @param createReqVO
* @return
*/
CommonResult createExpenseClaim(@Valid ExpenseClaimCreateReqVO createReqVO);
/**
*
*
* @param id
*/
void deleteExpenseClaim(Long id);
/**
*
*
* @param id
* @return
*/
ExpenseClaimDO getExpenseClaim(Long id);
/**
*
*
* @param ids
* @return
*/
List<ExpenseClaimDO> getExpenseClaimList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ExpenseClaimDO> getExpenseClaimPage(ExpenseClaimPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ExpenseClaimDO> getExpenseClaimList(ExpenseClaimExportReqVO exportReqVO);
void setNickNameField(List<ExpenseClaimDO> toList);
void setDeptNameField(List<ExpenseClaimDO> toList);
}

@ -0,0 +1,184 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaim;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.module.bpm.service.expenseclaimdetail.ExpenseClaimDetailService;
import cn.iocoder.yudao.module.bpm.service.expenseclaimtrip.ExpenseClaimTripService;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.*;
import cn.iocoder.yudao.module.bs.convert.expenseclaim.ExpenseClaimConvert;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import cn.iocoder.yudao.module.bs.dal.mysql.expenseclaim.ExpenseClaimMapper;
import cn.iocoder.yudao.module.bs.enums.BillTypeEnum;
import cn.iocoder.yudao.module.bs.enums.ExpenseApplyStatusEnum;
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.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.EXPENSE_CLAIM_NOT_EXISTS;
/**
* Service
*
* @author
*/
@Service
@Validated
@Transactional(rollbackFor = Exception.class)
public class ExpenseClaimServiceImpl extends MPJBaseServiceImpl<ExpenseClaimMapper, ExpenseClaimDO> implements ExpenseClaimService {
@Resource
private ExpenseClaimMapper expenseClaimMapper;
@Resource
private AdminUserApi adminUserApi;
@Resource
@Lazy
private ExpenseClaimTripService expenseClaimTripService;
@Resource
@Lazy
private ExpenseClaimDetailService expenseClaimDetailService;
@Resource
private DeptApi deptApi;
@Override
public CommonResult createExpenseClaim(ExpenseClaimCreateReqVO createReqVO) {
// 插入
ExpenseClaimDO expenseClaim = ExpenseClaimConvert.INSTANCE.convert(createReqVO);
CommonResult<Object> result = dataValidAndSetFileName(createReqVO, expenseClaim);
if (result.isError()) {
return result;
}
expenseClaimMapper.insert(expenseClaim);
// 返回
return CommonResult.success();
}
/**
*
*
* @param createReqVO
* @param expenseClaim
* @return
*/
private CommonResult<Object> dataValidAndSetFileName(ExpenseClaimCreateReqVO createReqVO, ExpenseClaimDO expenseClaim) {
boolean isAdd = createReqVO.getId() == null;
if (expenseClaim.getBillType().equals(BillTypeEnum.CLBX.getValue())) {
List<ExpenseClaimTripCreateReqVO> expenseApplyTrips = createReqVO.getExpenseClaimTrips();
// if (CollUtil.isEmpty(expenseApplyTrips)) {
// return CommonResult.error("差旅明细不能为空");
// }
// // 参数校验
// ValidationUtils.validate(validator, expenseApplyTrips);
BigDecimal amount = BigDecimal.ZERO;
for (ExpenseClaimTripCreateReqVO trip : expenseApplyTrips) {
BigDecimal tripAmount = BigDecimal.ZERO;
List<ExpenseClaimDetailCreateReqVO> details = trip.getExpenseClaimDetails();
if (CollUtil.isNotEmpty(details)) {
for (ExpenseClaimDetailCreateReqVO detail : details) {
tripAmount = tripAmount.add(detail.getAmount());
}
}
trip.setAmount(tripAmount);
amount = amount.add(tripAmount);
}
expenseClaim.setAmount(amount);
} else {
BigDecimal amount = BigDecimal.ZERO;
List<ExpenseClaimDetailDO> details = expenseClaim.getExpenseClaimDetails();
for (ExpenseClaimDetailDO detail : details) {
amount = amount.add(detail.getAmount());
}
expenseClaim.setAmount(amount);
}
if (isAdd) {
//新增
//cqptodo 单号的规则需要重写
expenseClaim.setClaimNo(RandomUtil.randomString(6));
} else {
ExpenseClaimDO dbApply = validateExpenseClaimExists(expenseClaim.getId());
if (!dbApply.getStatus().equals(ExpenseApplyStatusEnum.NOSUBMIT.getValue())) {
//只有未提交才能更新
return CommonResult.error("只有未提交单据才能更新");
}
}
LoginUser loginUser = getLoginUser();
expenseClaim.setUserId(loginUser.getId());
AdminUserRespDTO user = adminUserApi.getUser(loginUser.getId());
expenseClaim.setDeptId(user.getDeptId());
return CommonResult.success();
}
@Override
public void deleteExpenseClaim(Long id) {
// 校验存在
validateExpenseClaimExists(id);
// 删除
expenseClaimMapper.deleteById(id);
}
private ExpenseClaimDO validateExpenseClaimExists(Long id) {
ExpenseClaimDO expenseClaimDO = expenseClaimMapper.selectById(id);
if (expenseClaimDO == null) {
throw exception(EXPENSE_CLAIM_NOT_EXISTS);
}
return expenseClaimDO;
}
@Override
public ExpenseClaimDO getExpenseClaim(Long id) {
return expenseClaimMapper.selectById(id);
}
@Override
public List<ExpenseClaimDO> getExpenseClaimList(Collection<Long> ids) {
return expenseClaimMapper.selectBatchIds(ids);
}
@Override
public PageResult<ExpenseClaimDO> getExpenseClaimPage(ExpenseClaimPageReqVO pageReqVO) {
return expenseClaimMapper.selectPage(pageReqVO);
}
@Override
public List<ExpenseClaimDO> getExpenseClaimList(ExpenseClaimExportReqVO exportReqVO) {
return expenseClaimMapper.selectList(exportReqVO);
}
@Override
public void setNickNameField(List<ExpenseClaimDO> list) {
List<Long> userIds = list.stream().map(ExpenseClaimDO::getUserId).distinct().collect(Collectors.toList());
Map<Long, String> userMap = adminUserApi.getUserList(userIds).stream().collect(Collectors.toMap(AdminUserRespDTO::getId, user -> user.getNickname()));
for (ExpenseClaimDO expenseApply : list) {
expenseApply.setNickname(userMap.get(expenseApply.getUserId()));
}
}
@Override
public void setDeptNameField(List<ExpenseClaimDO> list) {
List<Long> deptIds = list.stream().map(claim -> claim.getCostDeptId()).distinct().collect(Collectors.toList());
Map<Long, String> deptMap = deptApi.getDeptList(deptIds).stream().collect(Collectors.toMap(DeptRespDTO::getId, dept -> dept.getName()));
for (ExpenseClaimDO expenseApply : list) {
expenseApply.setCostDeptName(deptMap.get(expenseApply.getDeptId()));
}
}
}

@ -0,0 +1,15 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaimdetail;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import com.github.yulichang.base.MPJBaseService;
/**
* Service
*
* @author
*/
public interface ExpenseClaimDetailService extends MPJBaseService<ExpenseClaimDetailDO> {
}

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaimdetail;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimdetail.ExpenseClaimDetailMapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ExpenseClaimDetailServiceImpl extends MPJBaseServiceImpl<ExpenseClaimDetailMapper, ExpenseClaimDetailDO> implements ExpenseClaimDetailService {
}

@ -0,0 +1,15 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaimtrip;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO;
import com.github.yulichang.base.MPJBaseService;
/**
* Service
*
* @author
*/
public interface ExpenseClaimTripService extends MPJBaseService<ExpenseClaimTripDO> {
}

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.bpm.service.expenseclaimtrip;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO;
import cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimtrip.ExpenseClaimTripMapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ExpenseClaimTripServiceImpl extends MPJBaseServiceImpl<ExpenseClaimTripMapper, ExpenseClaimTripDO> implements ExpenseClaimTripService {
}

@ -17,8 +17,10 @@ import java.util.stream.Collectors;
public enum BillTypeEnum {
CLSQ("CLSQ", "差旅申请单"),
RCSQ("RCSQ", "日常申请单");
RCSQ("RCSQ", "日常申请单"),
CLBX("CLBX", "差旅报销单"),
RCBX("RCBX", "日常报销单"),
;
/**
*

@ -14,4 +14,5 @@ public interface ErrorCodeConstants {
ErrorCode BUDGET_NOT_EXISTS = new ErrorCode(200400, "预算管理不存在");
ErrorCode FEE_MANAGE_NOT_EXISTS = new ErrorCode(200500, "费用控制不存在");
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(200600, "客户公司不存在");
ErrorCode EXPENSE_CLAIM_NOT_EXISTS = new ErrorCode(200700, "报销单不存在");
}

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.bs.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
*/
@AllArgsConstructor
@Getter
public enum ExpenseClaimSettleStatusEnum {
NOSETTLE("0", "未结算"),
WAITSETTLE("1", "待结算"),
FINISH("2", "已结算"),
;
/**
*
*/
private final String value;
/**
*
*/
private final String name;
}

@ -19,22 +19,6 @@ public class ExpenseApplyBaseVO {
@NotNull(message = "申请类型不能为空")
private String billType;
// @Schema(description = "申请者ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9227")
// @NotNull(message = "申请者ID不能为空")
// private Long userId;
//
// @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
// @NotNull(message = "用户昵称不能为空")
// private String nickname;
//
// @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32343")
// @NotNull(message = "部门ID不能为空")
// private Long deptId;
//
// @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
// @NotNull(message = "部门名称不能为空")
// private String deptName;
@Schema(description = "项目名称", example = "芋艿")
private String projectName;

@ -13,7 +13,7 @@ import javax.validation.constraints.AssertTrue;
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExpenseApplyCreateReqVO extends ExpenseApplyBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14225")
@Schema(description = "id")
private Long id;
@AssertTrue(message = "状态只能是0或者1提交")
public boolean isStatusValid() {

@ -0,0 +1,66 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ExpenseClaimBaseVO {
@Schema(description = "报销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "报销类型不能为空")
private String billType;
@Schema(description = "报销单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "报销单号不能为空")
private String claimNo;
@Schema(description = "申请者ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31597")
@NotNull(message = "申请者ID不能为空")
private Long userId;
@Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16015")
@NotNull(message = "部门ID不能为空")
private Long deptId;
@Schema(description = "项目名称", example = "赵六")
private String projectName;
@Schema(description = "报销事由", requiredMode = Schema.RequiredMode.REQUIRED, example = "不香")
@NotNull(message = "报销事由不能为空")
private String reason;
@Schema(description = "报销金额")
private BigDecimal amount;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "状态不能为空")
private String status;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "附件", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "附件不能为空")
private List<ImageVo> files;
@Schema(description = "流程实例的编号", example = "11882")
private String processInstanceId;
@Schema(description = "费用归属部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "26990")
@NotNull(message = "费用归属部门不能为空")
private Long costDeptId;
@Schema(description = "关联发票ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "关联发票ID不能为空")
private String invoiceIds;
}

@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import cn.iocoder.yudao.module.bs.enums.BillTypeEnum;
import cn.iocoder.yudao.module.bs.enums.ExpenseApplyStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@Schema(description = "管理后台 - 报销单创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExpenseClaimCreateReqVO extends ExpenseClaimBaseVO {
@Schema(description = "id")
private Long id;
@Schema(description = "报销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "报销类型不能为空")
private String billType;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "报销事由")
@NotNull(message = "报销事由")
private String reason;
@NotNull(message = "申请事由")
private Long costDeptId;
@NotBlank(message = "状态不能为空")
private String status;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "附件", requiredMode = Schema.RequiredMode.REQUIRED)
private List<ImageVo> files;
@Schema(description = "行程明细,仅为差旅报销单的时候需要传", example = "")
private List<ExpenseClaimTripCreateReqVO> expenseClaimTrips;
@Schema(description = "费用明细,仅为日常报销单的时候需要传", example = "")
private List<ExpenseClaimDetailCreateReqVO> expenseClaimDetails;
@AssertTrue(message = "差旅报销单的行程明细及其报销明细不能为空")
public boolean isTripsValid() {
if (BillTypeEnum.CLBX.getValue().equals(billType) && CollUtil.isEmpty(expenseClaimTrips)) {
return false;
}
return true;
}
@AssertTrue(message = "日常报销单的报销明细不能为空")
public boolean isDetailsValid() {
if (BillTypeEnum.RCBX.getValue().equals(billType) && CollUtil.isEmpty(expenseClaimDetails)) {
return false;
}
return true;
}
@AssertTrue(message = "状态只能是0或者1提交")
public boolean isStatusValid() {
//只能传未提交和待审核
return getStatus().equals(ExpenseApplyStatusEnum.NOSUBMIT.getValue()) || getStatus().equals(ExpenseApplyStatusEnum.PROCESS.getValue());
}
}

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 报销单创建 Request VO")
@Data
@ToString(callSuper = true)
public class ExpenseClaimDetailCreateReqVO {
@Schema(description = "费用类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "费用类型不能为空")
private String feeType;
@Schema(description = "金额")
@NotNull(message = "金额不能为空")
private BigDecimal amount;
@Schema(description = "发票/凭证张数", example = "24048")
@NotNull(message = "发票/凭证张数不能为空")
private Integer invoiceCount;
@Schema(description = "备注", example = "你说的对")
private String remark;
}

@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
* Excel VO
*
* @author
*/
@Data
public class ExpenseClaimExcelVO {
@ExcelProperty("id")
private Long id;
@ExcelProperty("报销类型")
private String billType;
@ExcelProperty("报销单号")
private String claimNo;
@ExcelProperty("申请者ID")
private Long userId;
@ExcelProperty("部门ID")
private Long deptId;
@ExcelProperty("项目名称")
private String projectName;
@ExcelProperty("报销事由")
private String reason;
@ExcelProperty("报销金额")
private BigDecimal amount;
@ExcelProperty("状态")
private String status;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("附件")
private List<ImageVo> files;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("流程实例的编号")
private String processInstanceId;
@ExcelProperty("费用归属部门")
private Long costDeptId;
@ExcelProperty("关联发票ID")
private String invoiceIds;
}

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 报销单 Excel 导出 Request VO参数和 ExpenseClaimPageReqVO 是一致的")
@Data
public class ExpenseClaimExportReqVO {
@Schema(description = "报销类型", example = "2")
private String billType;
@Schema(description = "报销单号")
private String claimNo;
@Schema(description = "申请者ID", example = "31597")
private Long userId;
@Schema(description = "部门ID", example = "16015")
private Long deptId;
@Schema(description = "项目名称", example = "赵六")
private String projectName;
@Schema(description = "报销事由", example = "不香")
private String reason;
@Schema(description = "报销金额")
private BigDecimal amount;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "附件")
private List<ImageVo> files;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实例的编号", example = "11882")
private String processInstanceId;
@Schema(description = "费用归属部门", example = "26990")
private Long costDeptId;
@Schema(description = "关联发票ID")
private String invoiceIds;
}

@ -0,0 +1,66 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 报销单分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExpenseClaimPageReqVO extends PageParam {
@Schema(description = "报销类型", example = "2")
private String billType;
@Schema(description = "报销单号")
private String claimNo;
@Schema(description = "申请者ID", example = "31597")
private Long userId;
@Schema(description = "部门ID", example = "16015")
private Long deptId;
@Schema(description = "项目名称", example = "赵六")
private String projectName;
@Schema(description = "报销事由", example = "不香")
private String reason;
@Schema(description = "报销金额")
private BigDecimal amount;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "附件")
private List<ImageVo> files;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实例的编号", example = "11882")
private String processInstanceId;
@Schema(description = "费用归属部门", example = "26990")
private Long costDeptId;
@Schema(description = "关联发票ID")
private String invoiceIds;
}

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 报销单 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExpenseClaimRespVO extends ExpenseClaimBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14131")
private Long id;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import cn.iocoder.yudao.module.bs.controller.admin.expenseapplytrip.vo.ExpenseApplyTripCreateReqVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
@Schema(description = "管理后台 - 报销单创建 Request VO")
@Data
@ToString(callSuper = true)
public class ExpenseClaimTripCreateReqVO {
@Schema(description = "出发地编码,二级市", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "出发地编码,二级市不能为空")
private String departureLocation;
@Schema(description = "目的地编码,二级市", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "目的地编码,二级市不能为空")
private String destinationLocation;
@Schema(description = "开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "开始日期不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private LocalDateTime startTime;
@Schema(description = "结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "结束日期不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private LocalDateTime endTime;
@Schema(description = "出差天数")
@NotNull(message = "出差天数不能为空")
private BigDecimal tripDay;
@Schema(description = "出差类型")
@NotNull(message = "出差类型不能为空")
private String tripType;
@Schema(description = "出差同行人")
private Set<Long> tripPartners;
//
@Schema(description = "预计费用")
private BigDecimal amount;
@Schema(description = "费用明细", example = "")
private List<ExpenseClaimDetailCreateReqVO> expenseClaimDetails;
}

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 报销单更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ExpenseClaimUpdateReqVO extends ExpenseClaimBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14131")
@NotNull(message = "id不能为空")
private Long id;
}

@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.bs.convert.expenseclaim;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimCreateReqVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimExcelVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimRespVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimUpdateReqVO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* Convert
*
* @author
*/
@Mapper
public interface ExpenseClaimConvert {
ExpenseClaimConvert INSTANCE = Mappers.getMapper(ExpenseClaimConvert.class);
ExpenseClaimDO convert(ExpenseClaimCreateReqVO bean);
ExpenseClaimDO convert(ExpenseClaimUpdateReqVO bean);
ExpenseClaimRespVO convert(ExpenseClaimDO bean);
List<ExpenseClaimRespVO> convertList(List<ExpenseClaimDO> list);
PageResult<ExpenseClaimRespVO> convertPage(PageResult<ExpenseClaimDO> page);
List<ExpenseClaimExcelVO> convertList02(List<ExpenseClaimDO> list);
}

@ -0,0 +1,109 @@
package cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import java.math.BigDecimal;
import java.util.List;
/**
* DO
*
* @author
*/
@TableName(value = "bs_expense_claim", autoResultMap = true)
@KeySequence("bs_expense_claim_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpenseClaimDO extends TenantBaseDO {
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String billType;
/**
*
*/
private String claimNo;
/**
* ID
*/
private Long userId;
/**
* ID
*/
private Long deptId;
/**
*
*/
private String projectName;
/**
*
*/
private String reason;
/**
*
*/
private BigDecimal amount;
/**
*
*/
private String status;
/**
*
*/
private String remark;
/**
*
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<ImageVo> files;
/**
*
*/
private String processInstanceId;
/**
*
*/
private Long costDeptId;
/**
*
*/
private String settleStatus;
/**
* ID
*/
private String invoiceIds;
@TableField(exist = false)
private List<ExpenseClaimTripDO> expenseClaimTrips;
@TableField(exist = false)
private List<ExpenseClaimDetailDO> expenseClaimDetails;
@TableField(exist = false)
private Boolean deleted;
@TableField(exist = false)
private String nickname;
@TableField(exist = false)
private String deptName;
@TableField(exist = false)
private String costDeptName;
}

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
/**
* DO
*
* @author
*/
@TableName(value = "bs_expense_claim_detail", autoResultMap = true)
@KeySequence("bs_expense_claim_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpenseClaimDetailDO extends TenantBaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* ID
*/
private Long claimId;
/**
*
*/
private String feeType;
/**
*
*/
private BigDecimal amount;
/**
* /
*/
private Integer invoiceCount;
/**
*
*/
private String remark;
/**
*
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<ImageVo> files;
/**
* ID
*/
@TableField(typeHandler = JsonLongSetTypeHandler.class)
private Set<Long> invoiceIds;
/**
* ID/
*/
private Long tripId;
@TableField(exist = false)
private Boolean deleted;
}

@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* DO
*
* @author
*/
@TableName(value = "bs_expense_claim_trip", autoResultMap = true)
@KeySequence("bs_expense_claim_trip_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpenseClaimTripDO extends TenantBaseDO {
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String departureLocation;
/**
*
*/
private String destinationLocation;
/**
*
*/
private LocalDateTime startTime;
/**
*
*/
private LocalDateTime endTime;
/**
*
*/
private BigDecimal tripDay;
/**
*
*/
private String tripType;
/**
*
*/
@TableField(typeHandler = JsonLongSetTypeHandler.class)
private Set<Long> tripPartners;
/**
*
*/
private BigDecimal amount;
/**
*
*/
private String remark;
/**
*
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<ImageVo> files;
/**
* ID
*/
private Long claimId;
@TableField(exist = false)
private Boolean deleted;
@TableField(exist = false)
private List<ExpenseClaimDetailDO> expenseClaimDetails;
}

@ -0,0 +1,59 @@
package cn.iocoder.yudao.module.bs.dal.mysql.expenseclaim;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimExportReqVO;
import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.ExpenseClaimPageReqVO;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ExpenseClaimMapper extends BaseMapperX<ExpenseClaimDO> {
default PageResult<ExpenseClaimDO> selectPage(ExpenseClaimPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ExpenseClaimDO>()
.eqIfPresent(ExpenseClaimDO::getBillType, reqVO.getBillType())
.eqIfPresent(ExpenseClaimDO::getClaimNo, reqVO.getClaimNo())
.eqIfPresent(ExpenseClaimDO::getUserId, reqVO.getUserId())
.eqIfPresent(ExpenseClaimDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(ExpenseClaimDO::getProjectName, reqVO.getProjectName())
.eqIfPresent(ExpenseClaimDO::getReason, reqVO.getReason())
.eqIfPresent(ExpenseClaimDO::getAmount, reqVO.getAmount())
.eqIfPresent(ExpenseClaimDO::getStatus, reqVO.getStatus())
.eqIfPresent(ExpenseClaimDO::getRemark, reqVO.getRemark())
.eqIfPresent(ExpenseClaimDO::getFiles, reqVO.getFiles())
.betweenIfPresent(ExpenseClaimDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ExpenseClaimDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(ExpenseClaimDO::getCostDeptId, reqVO.getCostDeptId())
.eqIfPresent(ExpenseClaimDO::getInvoiceIds, reqVO.getInvoiceIds())
.orderByDesc(ExpenseClaimDO::getId));
}
default List<ExpenseClaimDO> selectList(ExpenseClaimExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ExpenseClaimDO>()
.eqIfPresent(ExpenseClaimDO::getBillType, reqVO.getBillType())
.eqIfPresent(ExpenseClaimDO::getClaimNo, reqVO.getClaimNo())
.eqIfPresent(ExpenseClaimDO::getUserId, reqVO.getUserId())
.eqIfPresent(ExpenseClaimDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(ExpenseClaimDO::getProjectName, reqVO.getProjectName())
.eqIfPresent(ExpenseClaimDO::getReason, reqVO.getReason())
.eqIfPresent(ExpenseClaimDO::getAmount, reqVO.getAmount())
.eqIfPresent(ExpenseClaimDO::getStatus, reqVO.getStatus())
.eqIfPresent(ExpenseClaimDO::getRemark, reqVO.getRemark())
.eqIfPresent(ExpenseClaimDO::getFiles, reqVO.getFiles())
.betweenIfPresent(ExpenseClaimDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ExpenseClaimDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(ExpenseClaimDO::getCostDeptId, reqVO.getCostDeptId())
.eqIfPresent(ExpenseClaimDO::getInvoiceIds, reqVO.getInvoiceIds())
.orderByDesc(ExpenseClaimDO::getId));
}
}

@ -0,0 +1,17 @@
package cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimdetail;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ExpenseClaimDetailMapper extends BaseMapperX<ExpenseClaimDetailDO> {
}

@ -0,0 +1,16 @@
package cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimtrip;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ExpenseClaimTripMapper extends BaseMapperX<ExpenseClaimTripDO> {
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.bs.dal.mysql.expenseclaim.ExpenseClaimMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimdetail.ExpenseClaimDetailMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.bs.dal.mysql.expenseclaimtrip.ExpenseClaimTripMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save