Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -0,0 +1,106 @@
|
|||||||
|
package com.ruoyi.web.controller.oa;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimVo;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimBo;
|
||||||
|
import com.ruoyi.oa.service.ISysOaClaimService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/oaClaim")
|
||||||
|
public class SysOaClaimController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysOaClaimService iSysOaClaimService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysOaClaimVo> list(SysOaClaimBo bo, PageQuery pageQuery) {
|
||||||
|
return iSysOaClaimService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出差旅费报销列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:export")
|
||||||
|
@Log(title = "差旅费报销", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysOaClaimBo bo, HttpServletResponse response) {
|
||||||
|
List<SysOaClaimVo> list = iSysOaClaimService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "差旅费报销", SysOaClaimVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取差旅费报销详细信息
|
||||||
|
*
|
||||||
|
* @param claimId 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:query")
|
||||||
|
@GetMapping("/{claimId}")
|
||||||
|
public R<SysOaClaimVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long claimId) {
|
||||||
|
return R.ok(iSysOaClaimService.queryById(claimId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增差旅费报销
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:add")
|
||||||
|
@Log(title = "差旅费报销", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOaClaimBo bo) {
|
||||||
|
return toAjax(iSysOaClaimService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改差旅费报销
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:edit")
|
||||||
|
@Log(title = "差旅费报销", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOaClaimBo bo) {
|
||||||
|
return toAjax(iSysOaClaimService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除差旅费报销
|
||||||
|
*
|
||||||
|
* @param claimIds 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaim:remove")
|
||||||
|
@Log(title = "差旅费报销", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{claimIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] claimIds) {
|
||||||
|
return toAjax(iSysOaClaimService.deleteWithValidByIds(Arrays.asList(claimIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.ruoyi.web.controller.oa;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimDetailVo;
|
||||||
|
import com.ruoyi.oa.service.ISysOaClaimDetailService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/oaClaimDetail")
|
||||||
|
public class SysOaClaimDetailController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysOaClaimDetailService iSysOaClaimDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysOaClaimDetailVo> list(SysOaClaimDetailBo bo, PageQuery pageQuery) {
|
||||||
|
return iSysOaClaimDetailService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出报销明细列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:export")
|
||||||
|
@Log(title = "报销明细", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysOaClaimDetailBo bo, HttpServletResponse response) {
|
||||||
|
List<SysOaClaimDetailVo> list = iSysOaClaimDetailService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "报销明细", SysOaClaimDetailVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报销明细详细信息
|
||||||
|
*
|
||||||
|
* @param claimDetailId 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:query")
|
||||||
|
@GetMapping("/{claimDetailId}")
|
||||||
|
public R<SysOaClaimDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long claimDetailId) {
|
||||||
|
return R.ok(iSysOaClaimDetailService.queryById(claimDetailId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增报销明细
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:add")
|
||||||
|
@Log(title = "报销明细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOaClaimDetailBo bo) {
|
||||||
|
return toAjax(iSysOaClaimDetailService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报销明细
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:edit")
|
||||||
|
@Log(title = "报销明细", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOaClaimDetailBo bo) {
|
||||||
|
return toAjax(iSysOaClaimDetailService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报销明细
|
||||||
|
*
|
||||||
|
* @param claimDetailIds 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:oaClaimDetail:remove")
|
||||||
|
@Log(title = "报销明细", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{claimDetailIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] claimDetailIds) {
|
||||||
|
return toAjax(iSysOaClaimDetailService.deleteWithValidByIds(Arrays.asList(claimDetailIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -208,6 +208,18 @@ public class WfProcessController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据流程定义id启动流程实例
|
||||||
|
*
|
||||||
|
* @param variables 变量集合,json对象
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:process:start")
|
||||||
|
@PostMapping("/startClaim")
|
||||||
|
public R<String> startClaim(@RequestBody Map<String, Object> variables) {
|
||||||
|
String procInsId = processService.startClaim(variables);
|
||||||
|
return R.ok("流程启动成功",procInsId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除流程实例
|
* 删除流程实例
|
||||||
*
|
*
|
||||||
|
|||||||
79
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SysOaClaim.java
Normal file
79
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SysOaClaim.java
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
package com.ruoyi.oa.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销对象 sys_oa_claim
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sys_oa_claim")
|
||||||
|
public class SysOaClaim extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "claim_id")
|
||||||
|
private Long claimId;
|
||||||
|
/**
|
||||||
|
* 报销人
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 票据文件id列表
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
/**
|
||||||
|
* 报销缘由/备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 出差天数
|
||||||
|
*/
|
||||||
|
private Long tripDays;
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
private Double cost;
|
||||||
|
/**
|
||||||
|
* 票据总数
|
||||||
|
*/
|
||||||
|
private Long detailNumber;
|
||||||
|
/**
|
||||||
|
* 关联项目
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 删除标志
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
/**
|
||||||
|
* 关联流程id
|
||||||
|
*/
|
||||||
|
private String procInsId;
|
||||||
|
/**
|
||||||
|
* 报销时间
|
||||||
|
*/
|
||||||
|
private Date completedTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.ruoyi.oa.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细对象 sys_oa_claim_detail
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sys_oa_claim_detail")
|
||||||
|
public class SysOaClaimDetail extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "claim_detail_id")
|
||||||
|
private Long claimDetailId;
|
||||||
|
/**
|
||||||
|
* 外键id
|
||||||
|
*/
|
||||||
|
private Long claimId;
|
||||||
|
/**
|
||||||
|
* 报销类型
|
||||||
|
*/
|
||||||
|
private Long claimType;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date beginTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 入住地点
|
||||||
|
*/
|
||||||
|
private String lodgingAddress;
|
||||||
|
/**
|
||||||
|
* 删除标志
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 文件id列表
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
private Double cost;
|
||||||
|
/**
|
||||||
|
* 报销金额大写
|
||||||
|
*/
|
||||||
|
private String bigCost;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.ruoyi.oa.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销业务对象 sys_oa_claim
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysOaClaimBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long claimId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销人
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 票据文件id列表
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销缘由/备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差天数
|
||||||
|
*/
|
||||||
|
private Long tripDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 票据总数
|
||||||
|
*/
|
||||||
|
private Long detailNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联项目
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联流程id
|
||||||
|
*/
|
||||||
|
private String procInsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销时间
|
||||||
|
*/
|
||||||
|
private Date completedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 细节列表
|
||||||
|
*/
|
||||||
|
private List<SysOaClaimDetailBo> claimDetailList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.ruoyi.oa.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细业务对象 sys_oa_claim_detail
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysOaClaimDetailBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||||
|
private Long claimDetailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外键id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "外键id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long claimId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销类型
|
||||||
|
*/
|
||||||
|
@NotNull(message = "报销类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long claimType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date beginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入住地点
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "入住地点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String lodgingAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件id列表
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "文件id列表不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
@NotNull(message = "报销金额不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额大写
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "报销金额大写不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String bigCost;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.ruoyi.oa.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细视图对象 sys_oa_claim_detail
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SysOaClaimDetailVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键id")
|
||||||
|
private Long claimDetailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "外键id")
|
||||||
|
private Long claimId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销类型", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "claim_detail_type")
|
||||||
|
private Long claimType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "开始时间")
|
||||||
|
private Date beginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入住地点
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "入住地点")
|
||||||
|
private String lodgingAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件id列表
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "文件id列表")
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销金额")
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额大写
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销金额大写")
|
||||||
|
private String bigCost;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
112
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SysOaClaimVo.java
Normal file
112
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SysOaClaimVo.java
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
package com.ruoyi.oa.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaim;
|
||||||
|
import com.ruoyi.oa.domain.SysOaFile;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销视图对象 sys_oa_claim
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SysOaClaimVo extends SysOaClaim {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键id")
|
||||||
|
private Long claimId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销人
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销人")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 票据文件id列表
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "票据文件id列表")
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销缘由/备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销缘由/备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差天数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "出差天数")
|
||||||
|
private Long tripDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销金额
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销金额")
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 票据总数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "票据总数")
|
||||||
|
private Long detailNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联项目
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联项目")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联流程id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联流程id")
|
||||||
|
private String procInsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "报销时间")
|
||||||
|
private Date completedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销细节
|
||||||
|
*/
|
||||||
|
private List<SysOaClaimDetailVo> detailList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件列表
|
||||||
|
*/
|
||||||
|
private List<SysOaFile> fileList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.oa.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimDetailVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
public interface SysOaClaimDetailMapper extends BaseMapperPlus<SysOaClaimDetailMapper, SysOaClaimDetail, SysOaClaimDetailVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.oa.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaim;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
public interface SysOaClaimMapper extends BaseMapperPlus<SysOaClaimMapper, SysOaClaim, SysOaClaimVo> {
|
||||||
|
|
||||||
|
SysOaClaimVo selectSysOaClaimVoById(Long claimId);
|
||||||
|
|
||||||
|
Page<SysOaClaimVo> selectPageVo(Page<Object> build, LambdaQueryWrapper<SysOaClaim> lqw);
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.oa.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimDetailVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细Service接口
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
public interface ISysOaClaimDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细
|
||||||
|
*/
|
||||||
|
SysOaClaimDetailVo queryById(Long claimDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SysOaClaimDetailVo> queryPageList(SysOaClaimDetailBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细列表
|
||||||
|
*/
|
||||||
|
List<SysOaClaimDetailVo> queryList(SysOaClaimDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增报销明细
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SysOaClaimDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报销明细
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SysOaClaimDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除报销明细信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.oa.service;
|
||||||
|
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimVo;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
public interface ISysOaClaimService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销
|
||||||
|
*/
|
||||||
|
SysOaClaimVo queryById(Long claimId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SysOaClaimVo> queryPageList(SysOaClaimBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销列表
|
||||||
|
*/
|
||||||
|
List<SysOaClaimVo> queryList(SysOaClaimBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增差旅费报销
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SysOaClaimBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改差旅费报销
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SysOaClaimBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除差旅费报销信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.ruoyi.oa.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimDetailVo;
|
||||||
|
import com.ruoyi.oa.mapper.SysOaClaimDetailMapper;
|
||||||
|
import com.ruoyi.oa.service.ISysOaClaimDetailService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报销明细Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hdka
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SysOaClaimDetailServiceImpl implements ISysOaClaimDetailService {
|
||||||
|
|
||||||
|
private final SysOaClaimDetailMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysOaClaimDetailVo queryById(Long claimDetailId){
|
||||||
|
return baseMapper.selectVoById(claimDetailId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SysOaClaimDetailVo> queryPageList(SysOaClaimDetailBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SysOaClaimDetail> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SysOaClaimDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报销明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysOaClaimDetailVo> queryList(SysOaClaimDetailBo bo) {
|
||||||
|
LambdaQueryWrapper<SysOaClaimDetail> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SysOaClaimDetail> buildQueryWrapper(SysOaClaimDetailBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SysOaClaimDetail> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getClaimId() != null, SysOaClaimDetail::getClaimId, bo.getClaimId());
|
||||||
|
lqw.eq(bo.getClaimType() != null, SysOaClaimDetail::getClaimType, bo.getClaimType());
|
||||||
|
lqw.eq(bo.getBeginTime() != null, SysOaClaimDetail::getBeginTime, bo.getBeginTime());
|
||||||
|
lqw.eq(bo.getEndTime() != null, SysOaClaimDetail::getEndTime, bo.getEndTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLodgingAddress()), SysOaClaimDetail::getLodgingAddress, bo.getLodgingAddress());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFileIds()), SysOaClaimDetail::getFileIds, bo.getFileIds());
|
||||||
|
lqw.eq(bo.getCost() != null, SysOaClaimDetail::getCost, bo.getCost());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBigCost()), SysOaClaimDetail::getBigCost, bo.getBigCost());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增报销明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SysOaClaimDetailBo bo) {
|
||||||
|
SysOaClaimDetail add = BeanUtil.toBean(bo, SysOaClaimDetail.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setClaimDetailId(add.getClaimDetailId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改报销明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SysOaClaimDetailBo bo) {
|
||||||
|
SysOaClaimDetail update = BeanUtil.toBean(bo, SysOaClaimDetail.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SysOaClaimDetail entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除报销明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
package com.ruoyi.oa.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||||
|
import com.ruoyi.oa.service.ISysOaClaimDetailService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaClaimBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysOaClaimVo;
|
||||||
|
import com.ruoyi.oa.domain.SysOaClaim;
|
||||||
|
import com.ruoyi.oa.mapper.SysOaClaimMapper;
|
||||||
|
import com.ruoyi.oa.service.ISysOaClaimService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅费报销Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||||
|
|
||||||
|
private final SysOaClaimMapper baseMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysOaClaimDetailService sysOaClaimDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysOaClaimVo queryById(Long claimId){
|
||||||
|
return baseMapper.selectSysOaClaimVoById(claimId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SysOaClaimVo> queryPageList(SysOaClaimBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SysOaClaim> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SysOaClaimVo> result = baseMapper.selectPageVo(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询差旅费报销列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysOaClaimVo> queryList(SysOaClaimBo bo) {
|
||||||
|
LambdaQueryWrapper<SysOaClaim> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SysOaClaim> buildQueryWrapper(SysOaClaimBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SysOaClaim> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getUserId() != null, SysOaClaim::getUserId, bo.getUserId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFileIds()), SysOaClaim::getFileIds, bo.getFileIds());
|
||||||
|
lqw.eq(bo.getStartTime() != null, SysOaClaim::getStartTime, bo.getStartTime());
|
||||||
|
lqw.eq(bo.getEndTime() != null, SysOaClaim::getEndTime, bo.getEndTime());
|
||||||
|
lqw.eq(bo.getTripDays() != null, SysOaClaim::getTripDays, bo.getTripDays());
|
||||||
|
lqw.eq(bo.getCost() != null, SysOaClaim::getCost, bo.getCost());
|
||||||
|
lqw.eq(bo.getDetailNumber() != null, SysOaClaim::getDetailNumber, bo.getDetailNumber());
|
||||||
|
lqw.eq(bo.getProjectId() != null, SysOaClaim::getProjectId, bo.getProjectId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProcInsId()), SysOaClaim::getProcInsId, bo.getProcInsId());
|
||||||
|
lqw.eq(bo.getCompletedTime() != null, SysOaClaim::getCompletedTime, bo.getCompletedTime());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增差旅费报销
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SysOaClaimBo bo) {
|
||||||
|
bo.setUserId(LoginHelper.getUserId());
|
||||||
|
SysOaClaim add = BeanUtil.toBean(bo, SysOaClaim.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
for (SysOaClaimDetailBo sysOaClaimDetail : bo.getClaimDetailList()) {
|
||||||
|
sysOaClaimDetailService.insertByBo(sysOaClaimDetail);
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
bo.setClaimId(add.getClaimId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改差旅费报销
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SysOaClaimBo bo) {
|
||||||
|
SysOaClaim update = BeanUtil.toBean(bo, SysOaClaim.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SysOaClaim entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除差旅费报销
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?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="com.ruoyi.oa.mapper.SysOaClaimDetailMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.SysOaClaimDetail" id="SysOaClaimDetailResult">
|
||||||
|
<result property="claimDetailId" column="claim_detail_id"/>
|
||||||
|
<result property="claimId" column="claim_id"/>
|
||||||
|
<result property="claimType" column="claim_type"/>
|
||||||
|
<result property="beginTime" column="begin_time"/>
|
||||||
|
<result property="endTime" column="end_time"/>
|
||||||
|
<result property="lodgingAddress" column="lodging_address"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="fileIds" column="file_ids"/>
|
||||||
|
<result property="cost" column="cost"/>
|
||||||
|
<result property="bigCost" column="big_cost"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
126
ruoyi-oa/src/main/resources/mapper/oa/SysOaClaimMapper.xml
Normal file
126
ruoyi-oa/src/main/resources/mapper/oa/SysOaClaimMapper.xml
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?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="com.ruoyi.oa.mapper.SysOaClaimMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.vo.SysOaClaimVo" id="SysOaClaimResult">
|
||||||
|
<result property="claimId" column="claim_id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="fileIds" column="file_ids"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="startTime" column="start_time"/>
|
||||||
|
<result property="endTime" column="end_time"/>
|
||||||
|
<result property="tripDays" column="trip_days"/>
|
||||||
|
<result property="cost" column="cost"/>
|
||||||
|
<result property="detailNumber" column="detail_number"/>
|
||||||
|
<result property="projectId" column="project_id"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="procInsId" column="proc_ins_id"/>
|
||||||
|
<result property="status" column="status_"/>
|
||||||
|
<result property="completedTime" column="completed_time"/>
|
||||||
|
<collection property="detailList" javaType="list" resultMap="SysOaClaimDetailResult"/>
|
||||||
|
<collection property="fileList" javaType="list" resultMap="SysOaClaimDetailResult"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.SysOaClaimDetail" id="SysOaClaimDetailResult">
|
||||||
|
<result property="claimDetailId" column="claim_detail_id"/>
|
||||||
|
<result property="claimId" column="claim_id"/>
|
||||||
|
<result property="claimType" column="claim_type"/>
|
||||||
|
<result property="beginTime" column="begin_time"/>
|
||||||
|
<result property="endTime" column="end_time"/>
|
||||||
|
<result property="lodgingAddress" column="lodging_address"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="fileIds" column="file_ids"/>
|
||||||
|
<result property="cost" column="cost"/>
|
||||||
|
<result property="bigCost" column="big_cost"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.SysOaFile" id="SysOaFileResult">
|
||||||
|
<result property="fileId" column="file_id"/>
|
||||||
|
<result property="fileUrl" column="file_url"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectSysOaClaimVoById" resultMap="SysOaClaimResult">
|
||||||
|
SELECT soc.claim_id,
|
||||||
|
soc.user_id,
|
||||||
|
soc.file_ids,
|
||||||
|
soc.remark,
|
||||||
|
soc.start_time,
|
||||||
|
soc.end_time,
|
||||||
|
soc.trip_days,
|
||||||
|
soc.cost,
|
||||||
|
soc.detail_number,
|
||||||
|
soc.project_id,
|
||||||
|
soc.create_time,
|
||||||
|
soc.create_by,
|
||||||
|
soc.update_time,
|
||||||
|
soc.update_by,
|
||||||
|
soc.del_flag,
|
||||||
|
soc.proc_ins_id,
|
||||||
|
soc.completed_time,
|
||||||
|
sof.file_id,
|
||||||
|
file_url,
|
||||||
|
status,
|
||||||
|
socd.claim_detail_id,
|
||||||
|
claim_type,
|
||||||
|
begin_time,
|
||||||
|
socd.end_time,
|
||||||
|
socd.lodging_address,
|
||||||
|
socd.create_time,
|
||||||
|
socd.create_by,
|
||||||
|
socd.update_time,
|
||||||
|
socd.update_by,
|
||||||
|
socd.del_flag,
|
||||||
|
socd.remark,
|
||||||
|
socd.file_ids,
|
||||||
|
socd.cost,
|
||||||
|
socd.big_cost
|
||||||
|
FROM sys_oa_claim soc
|
||||||
|
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_detail_id
|
||||||
|
left JOIN sys_oa_file sof ON FIND_IN_SET(sof.file_id, soc.file_ids) > 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPageVo" resultMap="SysOaClaimResult">
|
||||||
|
SELECT soc.claim_id,
|
||||||
|
soc.user_id,
|
||||||
|
soc.file_ids,
|
||||||
|
soc.remark,
|
||||||
|
soc.start_time,
|
||||||
|
soc.end_time,
|
||||||
|
soc.trip_days,
|
||||||
|
soc.cost,
|
||||||
|
soc.detail_number,
|
||||||
|
soc.project_id,
|
||||||
|
soc.create_time,
|
||||||
|
soc.create_by,
|
||||||
|
soc.update_time,
|
||||||
|
soc.update_by,
|
||||||
|
soc.del_flag,
|
||||||
|
soc.proc_ins_id,
|
||||||
|
soc.completed_time,
|
||||||
|
IF(ahp.END_TIME_ IS NULL, 0, 1) AS status_
|
||||||
|
FROM sys_oa_claim soc
|
||||||
|
left join ACT_HI_PROCINST ahp on soc.proc_ins_id = ahp.PROC_INST_ID_
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -82,6 +82,7 @@ public interface IWfProcessService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动流程实例
|
* 启动流程实例
|
||||||
|
*
|
||||||
* @param procDefId 流程定义ID
|
* @param procDefId 流程定义ID
|
||||||
* @param variables 扩展参数
|
* @param variables 扩展参数
|
||||||
*/
|
*/
|
||||||
@@ -113,4 +114,12 @@ public interface IWfProcessService {
|
|||||||
* @param taskId 任务ID
|
* @param taskId 任务ID
|
||||||
*/
|
*/
|
||||||
WfDetailVo queryProcessDetail(String procInsId, String taskId);
|
WfDetailVo queryProcessDetail(String procInsId, String taskId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始报销模型
|
||||||
|
* @param variables
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String startClaim(Map<String, Object> variables);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -607,7 +607,6 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
*
|
*
|
||||||
* @param procDefId 流程定义Id
|
* @param procDefId 流程定义Id
|
||||||
* @param variables 流程变量
|
* @param variables 流程变量
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -622,6 +621,26 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据流程定义ID启动流程实例
|
||||||
|
*
|
||||||
|
* @param variables 流程变量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String startClaim(Map<String, Object> variables) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
||||||
|
.processDefinitionCategory("claim").singleResult();
|
||||||
|
return startProcess(processDefinition, variables);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new ServiceException("流程启动错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过DefinitionKey启动流程
|
* 通过DefinitionKey启动流程
|
||||||
* @param procDefKey 流程定义Key
|
* @param procDefKey 流程定义Key
|
||||||
@@ -708,8 +727,10 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动流程实例
|
* 启动流程实例
|
||||||
|
*
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
private void startProcess(ProcessDefinition procDef, Map<String, Object> variables) {
|
private String startProcess(ProcessDefinition procDef, Map<String, Object> variables) {
|
||||||
if (ObjectUtil.isNotNull(procDef) && procDef.isSuspended()) {
|
if (ObjectUtil.isNotNull(procDef) && procDef.isSuspended()) {
|
||||||
throw new ServiceException("流程已被挂起,请先激活流程");
|
throw new ServiceException("流程已被挂起,请先激活流程");
|
||||||
}
|
}
|
||||||
@@ -723,6 +744,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDef.getId(), variables);
|
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDef.getId(), variables);
|
||||||
// 第一个用户任务为发起人,则自动完成任务
|
// 第一个用户任务为发起人,则自动完成任务
|
||||||
wfTaskService.startFirstTask(processInstance, variables);
|
wfTaskService.startFirstTask(processInstance, variables);
|
||||||
|
return processInstance.getProcessInstanceId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
44
ruoyi-ui/src/api/oa/claim.js
Normal file
44
ruoyi-ui/src/api/oa/claim.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询差旅费报销列表
|
||||||
|
export function listOaClaim(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/oaClaim/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询差旅费报销详细
|
||||||
|
export function getOaClaim(claimId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/oaClaim/' + claimId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增差旅费报销
|
||||||
|
export function addOaClaim(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/oaClaim',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改差旅费报销
|
||||||
|
export function updateOaClaim(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/oaClaim',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除差旅费报销
|
||||||
|
export function delOaClaim(claimId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/oaClaim/' + claimId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
359
ruoyi-ui/src/views/oa/claim/index.vue
Normal file
359
ruoyi-ui/src/views/oa/claim/index.vue
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:oaClaim:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:oaClaim:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:oaClaim:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:oaClaim:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="oaClaimList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||||
|
<el-table-column label="报销缘由/备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="出差天数" align="center" prop="tripDays" />
|
||||||
|
<el-table-column label="报销金额" align="center" prop="cost" />
|
||||||
|
<el-table-column label="票据总数" align="center" prop="detailNumber" />
|
||||||
|
<el-table-column label="关联项目" align="center" prop="projectId" />
|
||||||
|
<el-table-column label="关联流程id" align="center" prop="procInsId" />
|
||||||
|
<el-table-column label="报销时间" align="center" prop="completedTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.completedTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:oaClaim:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:oaClaim:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改差旅费报销对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="报销人" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入报销人" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="票据文件id列表" prop="fileIds">
|
||||||
|
<el-input v-model="form.fileIds" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报销缘由/备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.startTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.endTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出差天数" prop="tripDays">
|
||||||
|
<el-input v-model="form.tripDays" placeholder="请输入出差天数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报销金额" prop="cost">
|
||||||
|
<el-input v-model="form.cost" placeholder="请输入报销金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="票据总数" prop="detailNumber">
|
||||||
|
<el-input v-model="form.detailNumber" placeholder="请输入票据总数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关联项目" prop="projectId">
|
||||||
|
<el-input v-model="form.projectId" placeholder="请输入关联项目" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关联流程id" prop="procInsId">
|
||||||
|
<el-input v-model="form.procInsId" placeholder="请输入关联流程id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报销时间" prop="completedTime">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.completedTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择报销时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOaClaim, getOaClaim, delOaClaim, addOaClaim, updateOaClaim } from "@/api/oa/claim";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "OaClaim",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 按钮loading
|
||||||
|
buttonLoading: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 差旅费报销表格数据
|
||||||
|
oaClaimList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userId: undefined,
|
||||||
|
fileIds: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
tripDays: undefined,
|
||||||
|
cost: undefined,
|
||||||
|
detailNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
procInsId: undefined,
|
||||||
|
completedTime: undefined
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
claimId: [
|
||||||
|
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
userId: [
|
||||||
|
{ required: true, message: "报销人不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
fileIds: [
|
||||||
|
{ required: true, message: "票据文件id列表不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
remark: [
|
||||||
|
{ required: true, message: "报销缘由/备注不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
startTime: [
|
||||||
|
{ required: true, message: "开始时间不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
endTime: [
|
||||||
|
{ required: true, message: "结束时间不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
tripDays: [
|
||||||
|
{ required: true, message: "出差天数不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
cost: [
|
||||||
|
{ required: true, message: "报销金额不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
detailNumber: [
|
||||||
|
{ required: true, message: "票据总数不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
projectId: [
|
||||||
|
{ required: true, message: "关联项目不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询差旅费报销列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOaClaim(this.queryParams).then(response => {
|
||||||
|
this.oaClaimList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
claimId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
fileIds: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
tripDays: undefined,
|
||||||
|
cost: undefined,
|
||||||
|
detailNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
delFlag: undefined,
|
||||||
|
procInsId: undefined,
|
||||||
|
completedTime: undefined
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.claimId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加差旅费报销";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.loading = true;
|
||||||
|
this.reset();
|
||||||
|
const claimId = row.claimId || this.ids
|
||||||
|
getOaClaim(claimId).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改差旅费报销";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.claimId != null) {
|
||||||
|
updateOaClaim(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOaClaim(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const claimIds = row.claimId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除差旅费报销编号为"' + claimIds + '"的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delOaClaim(claimIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/oaClaim/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `oaClaim_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -153,7 +153,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listProcess(this.queryParams).then(response => {
|
listProcess(this.queryParams).then(response => {
|
||||||
console.log(3333,response)
|
|
||||||
this.processList = response.rows;
|
this.processList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|||||||
@@ -226,33 +226,6 @@ export default {
|
|||||||
return arr;
|
return arr;
|
||||||
},
|
},
|
||||||
|
|
||||||
//对象数组排序(文本类)
|
|
||||||
/* compare(propertyName, order) {
|
|
||||||
return function (object1, object2) {
|
|
||||||
var value1 = object1[propertyName];
|
|
||||||
var value2 = object2[propertyName];
|
|
||||||
if (order == 0) {
|
|
||||||
if (value2 < value1) {
|
|
||||||
return -1;
|
|
||||||
} else if (value2 > value1) {
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (order == 1) {
|
|
||||||
if (value2 > value1) {
|
|
||||||
return -1;
|
|
||||||
} else if (value2 < value1) {
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},*/
|
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user