```feat(bpm): 整合财务支付管理模块
新增财务支付管理模块,包括财务支付的创建、更新、删除、查询等功能。通过引入FinancialPaymentDO类作为数据对象,实现与UI的交互。同时,更新了相关业务流程,如备用金申请、采购支付、报销等,确保与新模块的兼容性。 ```
This commit is contained in:
parent
b6ee116530
commit
edb2568f33
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpaymentitem.FinancialPaymentItemService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 财务支付管理")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/financial-payment")
|
||||
@Validated
|
||||
public class FinancialPaymentController {
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
@Resource
|
||||
private FinancialPaymentItemService financialPaymentItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建财务支付子表")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:create')")
|
||||
public CommonResult<Long> createFinancialPayment(@Valid @RequestBody FinancialPaymentSaveVO vo) {
|
||||
return success(financialPaymentService.createFinancialPayment(vo));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新财务支付管理")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:update')")
|
||||
public CommonResult<Boolean> updateFinancialPayment(@Valid @RequestBody FinancialPaymentSaveReqVO updateReqVO) {
|
||||
financialPaymentService.updateFinancialPayment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/receive/{id}")
|
||||
@Operation(summary = "领取财务支付管理")
|
||||
public CommonResult<Boolean> receive(@PathVariable Long id) {
|
||||
financialPaymentService.receive(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除财务支付管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:delete')")
|
||||
public CommonResult<Boolean> deleteFinancialPayment(@RequestParam("id") Long id) {
|
||||
financialPaymentService.deleteFinancialPayment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得财务支付管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:query')")
|
||||
public CommonResult<FinancialPaymentRespVO> getFinancialPayment(@RequestParam("id") Long id) {
|
||||
FinancialPaymentDO financialPayment = financialPaymentService.getFinancialPayment(id);
|
||||
FinancialPaymentRespVO vo = BeanUtils.toBean(financialPayment, FinancialPaymentRespVO.class);
|
||||
List<FinancialPaymentItemDO> list = financialPaymentItemService.getByFinancialPaymentId(id);
|
||||
List<FinancialPaymentItemRespVO> items = BeanUtils.toBean(list, FinancialPaymentItemRespVO.class);
|
||||
vo.setItems(items);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得财务支付管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:query')")
|
||||
public CommonResult<PageResult<FinancialPaymentRespVO>> getFinancialPaymentPage(@Valid FinancialPaymentPageReqVO pageReqVO) {
|
||||
PageResult<FinancialPaymentDO> pageResult = financialPaymentService.getFinancialPaymentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FinancialPaymentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo;
|
||||
|
||||
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 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 FinancialPaymentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "部门id", example = "13599")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "申请人的用户名称", example = "13599")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "流程实例id", example = "8972")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "流程类型 1现金支出 2备用金 3采购付款 4报销", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "支付状态 0待支付 1分批支付中 2已支付 3拒绝", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "领取类型 1未领取 2已领取 3我领取 4其他人领取", example = "16852")
|
||||
private Integer receiveType;
|
||||
|
||||
@Schema(description = "当前登陆用户id(领取人) 前端不用传")
|
||||
private Long receiveUserId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 财务支付管理 Response VO")
|
||||
@Data
|
||||
public class FinancialPaymentRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "81")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13599")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "申请人的用户名称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "流程实例id", example = "8972")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "申请费用原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "不好")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "流程类型 1现金支出 2备用金 3采购付款 4报销", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "支付状态 0待支付 1分批支付中 2已支付 3拒绝", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "领取的财务用户id", example = "16852")
|
||||
private Long receiveUserId;
|
||||
|
||||
@Schema(description = "领取的财务用户名称", example = "16852")
|
||||
private String receiveUserNickName;
|
||||
|
||||
@Schema(description = "应该支付金额")
|
||||
private BigDecimal amountPayable;
|
||||
|
||||
@Schema(description = "实际支付")
|
||||
private BigDecimal actualPayment;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "子列表")
|
||||
private List<FinancialPaymentItemRespVO> items;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 财务支付管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class FinancialPaymentSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "81")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13599")
|
||||
@NotNull(message = "申请人的用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "流程实例id", example = "8972")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "申请费用原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "不好")
|
||||
@NotEmpty(message = "申请费用原因不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "流程类型 1现金支出 2备用金 3采购付款 4报销", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "支付状态 0待支付 1分批支付中 2已支付 3拒绝", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "领取的财务用户id", example = "16852")
|
||||
private Long receiveUserId;
|
||||
|
||||
@Schema(description = "应该支付金额")
|
||||
private BigDecimal amountPayable;
|
||||
|
||||
@Schema(description = "实际支付")
|
||||
private BigDecimal actualPayment;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 财务支付管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class FinancialPaymentSaveVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "81")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "状态 1同意 2拒绝", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "支付信息")
|
||||
private FinancialPaymentItemSaveReqVO financialPaymentItemSaveReqVO;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpaymentitem.FinancialPaymentItemService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 财务支付子表")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/financial-payment-item")
|
||||
@Validated
|
||||
public class FinancialPaymentItemController {
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentItemService financialPaymentItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建财务支付子表")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment-item:create')")
|
||||
public CommonResult<Long> createFinancialPaymentItem(@Valid @RequestBody FinancialPaymentItemSaveReqVO createReqVO) {
|
||||
return success(financialPaymentItemService.createFinancialPaymentItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新财务支付子表")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment-item:update')")
|
||||
public CommonResult<Boolean> updateFinancialPaymentItem(@Valid @RequestBody FinancialPaymentItemSaveReqVO updateReqVO) {
|
||||
financialPaymentItemService.updateFinancialPaymentItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除财务支付子表")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment-item:delete')")
|
||||
public CommonResult<Boolean> deleteFinancialPaymentItem(@RequestParam("id") Long id) {
|
||||
financialPaymentItemService.deleteFinancialPaymentItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得财务支付子表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment-item:query')")
|
||||
public CommonResult<FinancialPaymentItemRespVO> getFinancialPaymentItem(@RequestParam("id") Long id) {
|
||||
FinancialPaymentItemDO financialPaymentItem = financialPaymentItemService.getFinancialPaymentItem(id);
|
||||
return success(BeanUtils.toBean(financialPaymentItem, FinancialPaymentItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得财务支付子表分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment-item:query')")
|
||||
public CommonResult<PageResult<FinancialPaymentItemRespVO>> getFinancialPaymentItemPage(@Valid FinancialPaymentItemPageReqVO pageReqVO) {
|
||||
PageResult<FinancialPaymentItemDO> pageResult = financialPaymentItemService.getFinancialPaymentItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FinancialPaymentItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
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 FinancialPaymentItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "财务支付id", example = "7319")
|
||||
private Long financialPaymentId;
|
||||
|
||||
@Schema(description = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注说明")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 财务支付子表 Response VO")
|
||||
@Data
|
||||
public class FinancialPaymentItemRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7277")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "财务支付id", example = "7319")
|
||||
private Long financialPaymentId;
|
||||
|
||||
@Schema(description = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注说明")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 财务支付子表新增/修改 Request VO")
|
||||
@Data
|
||||
public class FinancialPaymentItemSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7277")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "财务支付id", example = "7319")
|
||||
private Long financialPaymentId;
|
||||
|
||||
@Schema(description = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注说明")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
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 lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 财务支付管理 DO
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@TableName("bpm_financial_payment")
|
||||
@KeySequence("bpm_financial_payment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FinancialPaymentDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 对应流程类型oa业务id
|
||||
*/
|
||||
private Long objectId;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 申请费用原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 流程类型 1现金支出 2备用金 3采购付款 4报销
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 支付状态 0待支付 1分批支付中 2已支付 3拒绝
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 领取的财务用户id
|
||||
*/
|
||||
private Long receiveUserId;
|
||||
/**
|
||||
* 应该支付金额
|
||||
*/
|
||||
private BigDecimal amountPayable;
|
||||
/**
|
||||
* 实际支付
|
||||
*/
|
||||
private BigDecimal actualPayment;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
/**
|
||||
* 领取人用户名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String receiveUserNickName;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 财务支付子表 DO
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@TableName("bpm_financial_payment_item")
|
||||
@KeySequence("bpm_financial_payment_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FinancialPaymentItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 财务支付id
|
||||
*/
|
||||
private Long financialPaymentId;
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 备注说明
|
||||
*/
|
||||
private String notes;
|
||||
/**
|
||||
* 附件信息
|
||||
*/
|
||||
private String fileItems;
|
||||
|
||||
}
|
@ -49,6 +49,11 @@ public class BpmOAImprestDO extends BaseDO {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 费用类型
|
||||
*/
|
||||
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.financialpayment;
|
||||
|
||||
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.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 财务支付管理 Mapper
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Mapper
|
||||
public interface FinancialPaymentMapper extends BaseMapperX<FinancialPaymentDO> {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param vo
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<FinancialPaymentDO> getFinancialPaymentPage(@Param("vp") FinancialPaymentPageReqVO vo, @Param("page") Page page);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.financialpaymentitem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.*;
|
||||
|
||||
/**
|
||||
* 财务支付子表 Mapper
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Mapper
|
||||
public interface FinancialPaymentItemMapper extends BaseMapperX<FinancialPaymentItemDO> {
|
||||
|
||||
default PageResult<FinancialPaymentItemDO> selectPage(FinancialPaymentItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FinancialPaymentItemDO>()
|
||||
.eqIfPresent(FinancialPaymentItemDO::getFinancialPaymentId, reqVO.getFinancialPaymentId())
|
||||
.eqIfPresent(FinancialPaymentItemDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(FinancialPaymentItemDO::getNotes, reqVO.getNotes())
|
||||
.eqIfPresent(FinancialPaymentItemDO::getFileItems, reqVO.getFileItems())
|
||||
.betweenIfPresent(FinancialPaymentItemDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FinancialPaymentItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpayment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 财务支付管理 Service 接口
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
public interface FinancialPaymentService {
|
||||
|
||||
/**
|
||||
* 创建财务支付管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFinancialPayment(@Valid FinancialPaymentSaveVO vo);
|
||||
|
||||
/**
|
||||
* 更新财务支付管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFinancialPayment(@Valid FinancialPaymentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除财务支付管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFinancialPayment(Long id);
|
||||
|
||||
/**
|
||||
* 获得财务支付管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 财务支付管理
|
||||
*/
|
||||
FinancialPaymentDO getFinancialPayment(Long id);
|
||||
|
||||
/**
|
||||
* 获得财务支付管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 财务支付管理分页
|
||||
*/
|
||||
PageResult<FinancialPaymentDO> getFinancialPaymentPage(FinancialPaymentPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 插入财务支付
|
||||
*
|
||||
* @param financialPaymentDO
|
||||
*/
|
||||
void save(FinancialPaymentDO financialPaymentDO);
|
||||
|
||||
/**
|
||||
* 领取
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void receive(Long id);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param financialPayment
|
||||
*/
|
||||
void updateById(FinancialPaymentDO financialPayment);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpayment;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcurePayDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.financialpayment.FinancialPaymentMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.financialpaymentitem.FinancialPaymentItemMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAProcurePayMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
* 财务支付管理 Service 实现类
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentMapper financialPaymentMapper;
|
||||
@Resource
|
||||
private FinancialPaymentItemMapper financialPaymentItemMapper;
|
||||
@Resource
|
||||
private BpmOACashMapper cashMapper;
|
||||
@Resource
|
||||
private BpmOAImprestMapper imprestMapper;
|
||||
@Resource
|
||||
private BpmOAProcurePayMapper oAProcurePayMapper;
|
||||
@Resource
|
||||
private BpmOAReimbursementMapper reimbursementMapper;
|
||||
|
||||
@Override
|
||||
public Long createFinancialPayment(FinancialPaymentSaveVO vo) {
|
||||
FinancialPaymentItemSaveReqVO createReqVO = vo.getFinancialPaymentItemSaveReqVO();
|
||||
// 插入子表
|
||||
createReqVO.setFinancialPaymentId(vo.getId());
|
||||
FinancialPaymentItemDO financialPaymentItem = BeanUtils.toBean(createReqVO, FinancialPaymentItemDO.class);
|
||||
financialPaymentItemMapper.insert(financialPaymentItem);
|
||||
|
||||
// 查询财务支付信息 - 并且更新
|
||||
FinancialPaymentDO financialPayment = this.getFinancialPayment(vo.getId());
|
||||
if (vo.getStatus() == 1) {
|
||||
financialPayment.setActualPayment(financialPayment.getActualPayment().add(financialPaymentItem.getAmount()));
|
||||
if (financialPayment.getActualPayment().equals(financialPayment.getAmountPayable())) {
|
||||
financialPayment.setStatus(2);
|
||||
} else {
|
||||
financialPayment.setStatus(1);
|
||||
}
|
||||
} else {
|
||||
// TODO: 2024/8/18 - 驳回该流程通过流程实例id 发消息通知发起人 - 更改状态
|
||||
financialPayment.setStatus(3);
|
||||
// -- 修改流程状态
|
||||
if (financialPayment.getType() == 1) {
|
||||
cashMapper.updateById(new BpmOACashDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
} else if (financialPayment.getType() == 2) {
|
||||
imprestMapper.updateById(new BpmOAImprestDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
} else if (financialPayment.getType() == 3) {
|
||||
oAProcurePayMapper.updateById(new BpmOAProcurePayDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
} else if (financialPayment.getType() == 4) {
|
||||
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
}
|
||||
|
||||
// --- 发消息通知发起人
|
||||
|
||||
|
||||
}
|
||||
this.updateById(financialPayment);
|
||||
// 返回
|
||||
return financialPayment.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFinancialPayment(FinancialPaymentSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
FinancialPaymentDO updateObj = BeanUtils.toBean(updateReqVO, FinancialPaymentDO.class);
|
||||
financialPaymentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFinancialPayment(Long id) {
|
||||
// 删除
|
||||
financialPaymentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinancialPaymentDO getFinancialPayment(Long id) {
|
||||
return financialPaymentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FinancialPaymentDO> getFinancialPaymentPage(FinancialPaymentPageReqVO pageReqVO) {
|
||||
pageReqVO.setReceiveUserId(getLoginUserId());
|
||||
IPage<FinancialPaymentDO> vos = financialPaymentMapper.getFinancialPaymentPage(pageReqVO, MyBatisUtils.buildPage(pageReqVO));
|
||||
return new PageResult<>(vos.getRecords(), vos.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(FinancialPaymentDO financialPaymentDO) {
|
||||
financialPaymentMapper.insert(financialPaymentDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(Long id) {
|
||||
Long userId = getLoginUserId();
|
||||
financialPaymentMapper.updateById(new FinancialPaymentDO().setId(id).setReceiveUserId(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateById(FinancialPaymentDO financialPayment) {
|
||||
financialPaymentMapper.updateById(financialPayment);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpaymentitem;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 财务支付子表 Service 接口
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
public interface FinancialPaymentItemService {
|
||||
|
||||
/**
|
||||
* 创建财务支付子表
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFinancialPaymentItem(@Valid FinancialPaymentItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新财务支付子表
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFinancialPaymentItem(@Valid FinancialPaymentItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除财务支付子表
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFinancialPaymentItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得财务支付子表
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 财务支付子表
|
||||
*/
|
||||
FinancialPaymentItemDO getFinancialPaymentItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得财务支付子表分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 财务支付子表分页
|
||||
*/
|
||||
PageResult<FinancialPaymentItemDO> getFinancialPaymentItemPage(FinancialPaymentItemPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 根据财务支付id获取财务支付详情子表列表
|
||||
* @param financialPaymentId
|
||||
* @return
|
||||
*/
|
||||
List<FinancialPaymentItemDO> getByFinancialPaymentId(Long financialPaymentId);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpaymentitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.financialpaymentitem.FinancialPaymentItemMapper;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 财务支付子表 Service 实现类
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FinancialPaymentItemServiceImpl implements FinancialPaymentItemService {
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentItemMapper financialPaymentItemMapper;
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Override
|
||||
public Long createFinancialPaymentItem(FinancialPaymentItemSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FinancialPaymentItemDO financialPaymentItem = BeanUtils.toBean(createReqVO, FinancialPaymentItemDO.class);
|
||||
financialPaymentItemMapper.insert(financialPaymentItem);
|
||||
// 返回
|
||||
return financialPaymentItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFinancialPaymentItem(FinancialPaymentItemSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
FinancialPaymentItemDO updateObj = BeanUtils.toBean(updateReqVO, FinancialPaymentItemDO.class);
|
||||
financialPaymentItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFinancialPaymentItem(Long id) {
|
||||
// 删除
|
||||
financialPaymentItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinancialPaymentItemDO getFinancialPaymentItem(Long id) {
|
||||
return financialPaymentItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FinancialPaymentItemDO> getFinancialPaymentItemPage(FinancialPaymentItemPageReqVO pageReqVO) {
|
||||
return financialPaymentItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FinancialPaymentItemDO> getByFinancialPaymentId(Long financialPaymentId) {
|
||||
return financialPaymentItemMapper.selectList(new LambdaQueryWrapper<FinancialPaymentItemDO>()
|
||||
.eq(FinancialPaymentItemDO::getFinancialPaymentId, financialPaymentId));
|
||||
}
|
||||
|
||||
}
|
@ -6,10 +6,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateRe
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureListEditReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOACashConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -30,11 +32,10 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_CASH_NOT_E
|
||||
* OA 现金支出 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashService{
|
||||
public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashService {
|
||||
|
||||
/**
|
||||
* OA 现金支出对应的流程定义 KEY
|
||||
@ -53,6 +54,8 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
|
||||
@Resource
|
||||
private BpmOAProcureService bpmOAProcureService;
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Override
|
||||
public Long createCash(Long userId, BpmOACashCreateReqVO createReqVO) {
|
||||
@ -60,7 +63,7 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
//插入OA 现金支出申请
|
||||
BpmOACashDO cash = BpmOACashConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
cashMapper.insert(cash) ;
|
||||
cashMapper.insert(cash);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
@ -82,10 +85,10 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
);
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return cash.getId();
|
||||
}
|
||||
@ -115,6 +118,18 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
||||
);
|
||||
}
|
||||
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(cash.getUserId())
|
||||
.setProcessInstanceId(cash.getProcessInstanceId())
|
||||
.setReason(cash.getReason())
|
||||
.setObjectId(id)
|
||||
.setType(1)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(cash.getTotalMoney())
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,14 +9,13 @@ import javax.validation.Valid;
|
||||
* 备用金申请 Service 接口
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
public interface BpmOAImprestService {
|
||||
|
||||
/**
|
||||
* 创建备用金申请
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param userId 用户编号
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
@ -25,10 +24,10 @@ public interface BpmOAImprestService {
|
||||
/**
|
||||
* 更新备用金申请的状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param id 编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateImprestResult(Long id, Integer result);
|
||||
void updateImprestResult(String processInstanceId, Long id, Integer result);
|
||||
|
||||
/**
|
||||
* 获得备用金申请
|
||||
|
@ -5,9 +5,14 @@ import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.imprest.BpmOAImprestCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAImprestConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -23,11 +28,10 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_IMPREST_NO
|
||||
* OA 备用金申请 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAImprestService{
|
||||
public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAImprestService {
|
||||
|
||||
/**
|
||||
* OA 出差对应的流程定义 KEY
|
||||
@ -39,6 +43,11 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
@Resource
|
||||
@Lazy // 解决循环依赖
|
||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Override
|
||||
public Long createImprest(Long userId, BpmOAImprestCreateReqVO createReqVO) {
|
||||
@ -47,7 +56,7 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
BpmOAImprestDO imprest = BpmOAImprestConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||
.setStatus(BpmOAImprestDO.FLAG_FALSE)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
imprestMapper.insert(imprest) ;
|
||||
imprestMapper.insert(imprest);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
@ -58,19 +67,40 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
// 将工作流的编号,更新到 OA 备用金单中
|
||||
imprestMapper.updateById(new BpmOAImprestDO().setId(imprest.getId()).setProcessInstanceId(processInstanceId));
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return imprest.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateImprestResult(Long id, Integer result) {
|
||||
public void updateImprestResult(String processInstanceId, Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
imprestMapper.updateById(new BpmOAImprestDO().setId(id).setResult(result));
|
||||
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||
|
||||
if (instance.isEnded()) {
|
||||
//判断是否有采购报销
|
||||
BpmOAImprestDO cash = getImprest(id);
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(cash.getUserId())
|
||||
.setProcessInstanceId(cash.getProcessInstanceId())
|
||||
.setReason(cash.getReason())
|
||||
.setObjectId(id)
|
||||
.setType(2)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(cash.getAmount())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateLeaveExists(Long id) {
|
||||
|
@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procurepay.BpmOAProcur
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAProcurePayConvert;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAProcurePayItemConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcurePayDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcurePayItemDO;
|
||||
@ -23,6 +24,7 @@ import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAProcurePayMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmProcessInstanceExtMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
@ -66,6 +68,8 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
||||
@Resource
|
||||
@Lazy // 解决循环依赖
|
||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
/**
|
||||
* OA 采购支付对应的流程定义 KEY
|
||||
@ -155,14 +159,30 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
||||
// -- 审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||
if (instance.isEnded() && !items.isEmpty()) {
|
||||
List<Long> ids = items.stream().map(BpmOAProcurePayItemRespVO::getBpmOaProcureId).collect(Collectors.toList());
|
||||
//所有关联的采购申请改为 未支付状态
|
||||
oaProcureService.updatePayFlagByIds(
|
||||
new BpmOAProcureListEditReqVO()
|
||||
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
||||
.setProcureIds(ids)
|
||||
if (instance.isEnded()) {
|
||||
if (!items.isEmpty()) {
|
||||
List<Long> ids = items.stream().map(BpmOAProcurePayItemRespVO::getBpmOaProcureId).collect(Collectors.toList());
|
||||
//所有关联的采购申请改为 已支付状态
|
||||
oaProcureService.updatePayFlagByIds(
|
||||
new BpmOAProcureListEditReqVO()
|
||||
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
||||
.setProcureIds(ids)
|
||||
);
|
||||
}
|
||||
|
||||
//判断是否有采购报销
|
||||
BpmOAProcurePayDO cash = getOAProcurePay(id);
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(cash.getUserId())
|
||||
.setProcessInstanceId(cash.getProcessInstanceId())
|
||||
.setReason(cash.getReason())
|
||||
.setObjectId(id)
|
||||
.setType(3)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(cash.getTotalMoney())
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
// -- 自己取消
|
||||
@ -184,4 +204,4 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
||||
oAProcurePayMapper.updateById(new BpmOAProcurePayDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,12 +11,14 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimburs
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ReimbursementDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAReimbursementConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
@ -29,7 +31,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
@ -44,7 +49,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REIMBURSEM
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements BpmOAReimbursementService{
|
||||
public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements BpmOAReimbursementService {
|
||||
|
||||
/**
|
||||
* OA 请假对应的流程定义 KEY
|
||||
@ -52,7 +57,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
public static final String PROCESS_KEY = "oa_reimbursement";
|
||||
|
||||
@Resource
|
||||
private BpmOAReimbursementMapper reimbursementMapper ;
|
||||
private BpmOAReimbursementMapper reimbursementMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
@ -76,11 +81,15 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createReimbursement(Long userId, BpmOAReimbursementCreateReqVO createReqVO) {
|
||||
BpmOAReimbursementDO reimbursement = BpmOAReimbursementConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
reimbursementMapper.insert(reimbursement) ;
|
||||
reimbursementMapper.insert(reimbursement);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
@ -118,10 +127,10 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
);
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return reimbursement.getId();
|
||||
}
|
||||
@ -154,6 +163,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
String json = JsonUtils.toJsonString(reimbursements);
|
||||
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
|
||||
|
||||
StringBuilder reason = new StringBuilder();
|
||||
for (Reimbursement reimbursement : reimbursements) {
|
||||
|
||||
//报销类别为 采购费时
|
||||
@ -161,8 +171,20 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|
||||
procureIds.add(reimbursement.getProcureId());
|
||||
}
|
||||
reason.append(reimbursement.getDetail()).append(",");
|
||||
}
|
||||
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(bpmOAReimbursementDO.getUserId())
|
||||
.setProcessInstanceId(bpmOAReimbursementDO.getProcessInstanceId())
|
||||
.setReason(reason.toString())
|
||||
.setObjectId(id)
|
||||
.setType(4)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(bpmOAReimbursementDO.getTotalMoney())
|
||||
);
|
||||
|
||||
if (!procureIds.isEmpty()) {
|
||||
|
||||
//所有关联的采购申请改为 已支付状态
|
||||
@ -261,7 +283,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
}
|
||||
|
||||
//获取部门信息map
|
||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursement, Reimbursement::getDeptId));
|
||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursement, Reimbursement::getDeptId));
|
||||
|
||||
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursement, ReimbursementDTO.class);
|
||||
|
||||
@ -270,4 +292,4 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|
||||
return bpmOAReimbursementRespVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ public class BpmOAImprestResultListener extends BpmProcessInstanceResultEventLis
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||
imprestService.updateImprestResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
imprestService.updateImprestResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
}
|
||||
}
|
||||
|
@ -39,17 +39,17 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
|
@ -0,0 +1,65 @@
|
||||
<?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.bpm.dal.mysql.financialpayment.FinancialPaymentMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="getFinancialPaymentPage"
|
||||
resultType="cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO">
|
||||
select
|
||||
a.*,
|
||||
b.nickname as nickname,
|
||||
c.name as deptName,
|
||||
d.nickname as receiveUserNickName
|
||||
from bpm_financial_payment as a
|
||||
left join system_users as b on a.user_id = b.id
|
||||
left join system_dept as c on b.dept_id = c.id
|
||||
left join system_users as d on a.receive_user_id = d.id
|
||||
<where>
|
||||
a.deleted = 0
|
||||
<if test="vo.deptId != null">
|
||||
and b.dept_id = #{vo.deptId}
|
||||
</if>
|
||||
<if test="vo.nickname != null and vo.nickname != ''">
|
||||
and b.nickname like concat('%', #{vo.nickname}, '%')
|
||||
</if>
|
||||
<if test="vo.processInstanceId != null and vo.processInstanceId != ''">
|
||||
and a.process_instance_id = #{vo.processInstanceId}
|
||||
</if>
|
||||
<if test="vo.type != null">
|
||||
and a.type = #{vo.type}
|
||||
</if>
|
||||
<if test="vo.status != null">
|
||||
and a.status = #{vo.status}
|
||||
</if>
|
||||
<if test="vo.receiveType != null">
|
||||
<if test="vo.receiveType == 1">
|
||||
a.receive_user_id is null
|
||||
</if>
|
||||
<if test="vo.receiveType == 2">
|
||||
a.receive_user_id is not null
|
||||
</if>
|
||||
<if test="vo.receiveType == 3">
|
||||
a.receive_user_id = #{vo.receiveUserId}
|
||||
</if>
|
||||
<if test="vo.receiveType == 4">
|
||||
a.receive_user_id != #{vo.receiveUserId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="vo.createTime != null and vo.createTime.length > 0">
|
||||
<if test="vo.createTime[0] != null">
|
||||
and a.create_time >= #{vo.createTime[0]}
|
||||
</if>
|
||||
<if test="vo.createTime[1] != null">
|
||||
and a.create_time <= #{vo.createTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</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.bpm.dal.mysql.financialpaymentitem.FinancialPaymentItemMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -39,17 +39,17 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
|
@ -39,17 +39,17 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
@ -80,7 +80,7 @@ xxl:
|
||||
job:
|
||||
enabled: true # 是否开启调度中心,默认为 true 开启
|
||||
admin:
|
||||
addresses: http://192.168.1.107:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
executor:
|
||||
appname: ${spring.application.name} # 执行器 AppName
|
||||
ip: # 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
|
@ -39,17 +39,17 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
|
@ -39,17 +39,17 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
name: ruoyi-vue-pro
|
||||
url: jdbc:mysql://192.168.1.107:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
name: ruoyi-vue-pro-dev
|
||||
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
password: Znalyrds2024
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
|
Loading…
Reference in New Issue
Block a user