修改现金支出, 追加增加明细功能
修改报销流程打印功能, 根据配置文件判断是否过滤 外聘人员信息
This commit is contained in:
parent
8db27dd8d9
commit
21f034d94c
@ -5,7 +5,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateRe
|
|||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOACashConvert;
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOACashConvert;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -14,8 +19,11 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,6 +41,12 @@ public class BpmOACashController {
|
|||||||
@Resource
|
@Resource
|
||||||
private BpmOACashService cashService;
|
private BpmOACashService cashService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BankApi bankApi;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建请求申请")
|
@Operation(summary = "创建请求申请")
|
||||||
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
|
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
|
||||||
@ -47,6 +61,15 @@ public class BpmOACashController {
|
|||||||
|
|
||||||
BpmOACashDO cash = cashService.getCash(id);
|
BpmOACashDO cash = cashService.getCash(id);
|
||||||
|
|
||||||
return success(BpmOACashConvert.INSTANCE.convert(cash));
|
// 获取明细数据
|
||||||
|
List<BpmOACashItemDO> cashItemDOs = cashService.getCashItem(cash.getId());
|
||||||
|
|
||||||
|
//获取部门信息map
|
||||||
|
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(cashItemDOs, BpmOACashItemDO::getDeptId));
|
||||||
|
|
||||||
|
// 获取银行卡信息
|
||||||
|
BankRespDTO bankRespDTO = bankApi.getBank(cash.getBankId()).getCheckedData();
|
||||||
|
|
||||||
|
return success(BpmOACashConvert.INSTANCE.convert1(cash, cashItemDOs, deptMap, bankRespDTO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,11 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 现金支出 创建 Request VO
|
* 现金支出 创建 Request VO
|
||||||
*
|
*
|
||||||
@ -25,35 +21,15 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class BpmOACashCreateReqVO {
|
public class BpmOACashCreateReqVO {
|
||||||
|
|
||||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请事由不能为空")
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "费用类型不能为空")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "费用产生部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "费用产生部门不能为空")
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
@Schema(description = "采购申请编号")
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请金额不能为空")
|
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请日期不能为空")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
|
||||||
private LocalDate applicationDate;
|
|
||||||
|
|
||||||
@Schema(description = "收款人信息")
|
@Schema(description = "收款人信息")
|
||||||
private Long bankId;
|
private Long bankId;
|
||||||
|
|
||||||
@Schema(description = "备注说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "现金支出明细")
|
||||||
private String notes;
|
private List<Cash> cashItem;
|
||||||
|
|
||||||
|
@Schema(description = "报销总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "报销总金额不能为空")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<UploadUserFile> fileItems;
|
private List<UploadUserFile> fileItems;
|
||||||
|
@ -6,15 +6,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
*/
|
*/
|
||||||
@ -24,28 +19,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class BpmOACashRespVO extends BpmOABaseRespVO {
|
public class BpmOACashRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "收款人信息编号")
|
||||||
@NotNull(message = "申请事由不能为空")
|
private Long bankId;
|
||||||
private String reason;
|
|
||||||
|
|
||||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "费用类型不能为空")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "部门名称")
|
|
||||||
private String deptName;
|
|
||||||
|
|
||||||
@Schema(description = "采购申请编号")
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请金额不能为空")
|
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请日期不能为空")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
|
||||||
private LocalDate applicationDate;
|
|
||||||
|
|
||||||
@Schema(description = "收款人名称")
|
@Schema(description = "收款人名称")
|
||||||
private String payeeName;
|
private String payeeName;
|
||||||
@ -56,8 +31,11 @@ public class BpmOACashRespVO extends BpmOABaseRespVO {
|
|||||||
@Schema(description = "开户行名称")
|
@Schema(description = "开户行名称")
|
||||||
private String bankName;
|
private String bankName;
|
||||||
|
|
||||||
@Schema(description = "备注说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "现金支出明细")
|
||||||
private String notes;
|
private List<Cash> cashItem;
|
||||||
|
|
||||||
|
@Schema(description = "报销总金额")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<UploadUserFile> fileItems;
|
private List<UploadUserFile> fileItems;
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述 现金支出项目明细
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Cash {
|
||||||
|
|
||||||
|
@Schema(description = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "申请事由不能为空")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "费用类型不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "费用产生部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "费用产生部门不能为空")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "费用产生部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(description = "采购申请编号")
|
||||||
|
private Long procureId;
|
||||||
|
|
||||||
|
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "申请金额不能为空")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "申请日期不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
|
private LocalDate applicationDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String notes;
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 现金支出打印数回数据 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOACashPrintDataRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "现金支出业务数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BpmOACashRespVO bpmOACashRespVO ;
|
||||||
|
|
||||||
|
@Schema(description = "流程审批节点信息【包含人员签名地址】", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
List<BpmTaskRespVO> processTasks ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抄送用户信息
|
||||||
|
*/
|
||||||
|
private List<BpmOAReimbursementPrintDataRespVO.CCUser> ccUsers;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户信息")
|
||||||
|
@Data
|
||||||
|
public static class CCUser {
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户编号", example = "146,128")
|
||||||
|
private Long ccUserId;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户名称", example = "张三")
|
||||||
|
private String ccUserName;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户部门名称", example = "研发部")
|
||||||
|
private String ccDeptName;
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 流程打印响应数据 Item Response VO")
|
@Schema(description = "管理后台 - 流程打印响应数据 Item Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@ -21,4 +18,6 @@ public class BpmProcessInstancePrintDataRespVO {
|
|||||||
@Schema(description = "报销业务打印数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "报销业务打印数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private BpmOAReimbursementPrintDataRespVO bpmOAReimbursementPrintDataRespVO ;
|
private BpmOAReimbursementPrintDataRespVO bpmOAReimbursementPrintDataRespVO ;
|
||||||
|
|
||||||
|
@Schema(description = "现金支出业务打印数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BpmOACashPrintDataRespVO bpmOACashPrintDataRespVO;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.convert.oa;
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.Cash;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 现金支出 Convert
|
* 现金支出 Convert
|
||||||
*
|
*
|
||||||
@ -19,4 +28,39 @@ public interface BpmOACashConvert {
|
|||||||
BpmOACashDO convert(BpmOACashCreateReqVO bean);
|
BpmOACashDO convert(BpmOACashCreateReqVO bean);
|
||||||
|
|
||||||
BpmOACashRespVO convert(BpmOACashDO bean);
|
BpmOACashRespVO convert(BpmOACashDO bean);
|
||||||
|
|
||||||
|
default BpmOACashRespVO convert1(BpmOACashDO cashDO, List<BpmOACashItemDO> cashItemDOs,
|
||||||
|
Map<Long, DeptRespDTO> deptMap, BankRespDTO bankRespDTO) {
|
||||||
|
|
||||||
|
BpmOACashRespVO respVO = BeanUtils.toBean(cashDO, BpmOACashRespVO.class);
|
||||||
|
|
||||||
|
List<Cash> cashItems = BeanUtils.toBean(cashItemDOs, Cash.class);
|
||||||
|
if (deptMap != null) {
|
||||||
|
|
||||||
|
cashItems = convertList(cashItems, deptMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bankRespDTO != null) {
|
||||||
|
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||||
|
respVO.setBankName(bankRespDTO.getBankName());
|
||||||
|
respVO.setPayeeName(bankRespDTO.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
respVO.setCashItem(cashItems);
|
||||||
|
return respVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<Cash> convertList(List<Cash> list, Map<Long, DeptRespDTO> deptMap) {
|
||||||
|
|
||||||
|
return CollectionUtils.convertList(list, cash -> convert(cash, deptMap.get(cash.getDeptId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
default Cash convert(Cash cashItem, DeptRespDTO dept) {
|
||||||
|
|
||||||
|
if (dept != null) {
|
||||||
|
cashItem.setDeptName(dept.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return cashItem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,47 +38,12 @@ public class BpmOACashDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请理由
|
|
||||||
*/
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用类型 字典值参照 BPM_OA_REIMBURSEMENT_TYPE
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用产生部门
|
|
||||||
*/
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 采购申请 业务编号
|
|
||||||
*/
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 现金支出金额
|
|
||||||
*/
|
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请日期
|
|
||||||
*/
|
|
||||||
private LocalDate applicationDate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收款人信息
|
* 收款人信息
|
||||||
* system_bank 编号
|
* system_bank 编号
|
||||||
*/
|
*/
|
||||||
private Long bankId;
|
private Long bankId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注说明
|
|
||||||
*/
|
|
||||||
private String notes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用章的结果
|
* 用章的结果
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 现金支出明细 DO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@TableName(value ="bpm_oa_cash_item", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOACashItemDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金支出业务编号
|
||||||
|
*/
|
||||||
|
private Long cashId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请理由
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 费用类型 字典值参照 BPM_OA_REIMBURSEMENT_TYPE
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 费用产生部门
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购申请 业务编号
|
||||||
|
*/
|
||||||
|
private Long procureId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金支出金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请日期
|
||||||
|
*/
|
||||||
|
private LocalDate applicationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String notes;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金支出 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOACashItemMapper extends BaseMapperX<BpmOACashItemDO> {
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.framework.rpc.config;
|
package cn.iocoder.yudao.module.bpm.framework.rpc.config;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
||||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||||
import cn.iocoder.yudao.module.system.api.attendance.AttendanceApi;
|
import cn.iocoder.yudao.module.system.api.attendance.AttendanceApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
||||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||||
@ -17,7 +19,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
@EnableFeignClients(clients = {FileApi.class, RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
|
@EnableFeignClients(clients = {FileApi.class, RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
|
||||||
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class
|
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class, BankApi.class, ConfigApi.class
|
||||||
})
|
})
|
||||||
public class RpcConfiguration {
|
public class RpcConfiguration {
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.bpm.service.oa;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface BpmOACashService {
|
public interface BpmOACashService {
|
||||||
|
|
||||||
@ -31,4 +33,11 @@ public interface BpmOACashService {
|
|||||||
* @return 现金支出申请
|
* @return 现金支出申请
|
||||||
*/
|
*/
|
||||||
BpmOACashDO getCash(Long id);
|
BpmOACashDO getCash(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得指定得现金支出明细
|
||||||
|
* @param cashId 现金支出 编号
|
||||||
|
* @return 明细
|
||||||
|
*/
|
||||||
|
List<BpmOACashItemDO> getCashItem(Long cashId);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||||
@ -7,7 +9,9 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureLi
|
|||||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
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.convert.oa.BpmOACashConvert;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashItemMapper;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashMapper;
|
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.enums.task.BpmProcessInstanceResultEnum;
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||||
@ -18,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collections;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -44,6 +48,9 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
@Resource
|
@Resource
|
||||||
private BpmOACashMapper cashMapper;
|
private BpmOACashMapper cashMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOACashItemMapper cashItemMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BpmProcessInstanceApi processInstanceApi;
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
@ -62,6 +69,11 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
cashMapper.insert(cash) ;
|
cashMapper.insert(cash) ;
|
||||||
|
|
||||||
|
// 批量插入现金支出明细数据
|
||||||
|
List<BpmOACashItemDO> bpmOACashItemDOS = BeanUtils.toBean(createReqVO.getCashItem(), BpmOACashItemDO.class);
|
||||||
|
bpmOACashItemDOS.forEach(item -> item.setCashId(cash.getId()));
|
||||||
|
cashItemMapper.insertBatch(bpmOACashItemDOS);
|
||||||
|
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
@ -71,14 +83,21 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
// 将工作流的编号,更新到 OA 现金支出单中
|
// 将工作流的编号,更新到 OA 现金支出单中
|
||||||
cashMapper.updateById(new BpmOACashDO().setId(cash.getId()).setProcessInstanceId(processInstanceId));
|
cashMapper.updateById(new BpmOACashDO().setId(cash.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
//报销类别为 采购费时
|
List<Long> procureIds = new ArrayList<>();
|
||||||
if (cash.getType() == 4) {
|
for (BpmOACashItemDO cashItemDO : bpmOACashItemDOS) {
|
||||||
|
//报销类别为 采购费时
|
||||||
|
if (cashItemDO.getType() == 4) {
|
||||||
|
procureIds.add(cashItemDO.getProcureId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||||
|
|
||||||
//所有关联的采购申请改为 进行中状态
|
//所有关联的采购申请改为 进行中状态
|
||||||
bpmOAProcureService.updatePayFlagByIds(
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
new BpmOAProcureListEditReqVO()
|
new BpmOAProcureListEditReqVO()
|
||||||
.setPayFlag(BpmOAProcureDO.IN_PROGRESS)
|
.setPayFlag(BpmOAProcureDO.IN_PROGRESS)
|
||||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
.setProcureIds(procureIds)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +114,11 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
public void updateCashResult(String processInstanceId, Long id, Integer result) {
|
public void updateCashResult(String processInstanceId, Long id, Integer result) {
|
||||||
|
|
||||||
validateLeaveExists(id);
|
validateLeaveExists(id);
|
||||||
|
|
||||||
|
// 获取现金支出明细
|
||||||
|
List<BpmOACashItemDO> cashItemDOs = getCashItem(id);
|
||||||
|
|
||||||
|
List<Long> procureIds = new ArrayList<>();
|
||||||
//审核通过 (最后节点)
|
//审核通过 (最后节点)
|
||||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||||
|
|
||||||
@ -103,16 +127,20 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
if (instance.isEnded()) {
|
if (instance.isEnded()) {
|
||||||
|
|
||||||
//判断是否有采购报销
|
//判断是否有采购报销
|
||||||
BpmOACashDO cash = getCash(id);
|
for (BpmOACashItemDO cashItemDO : cashItemDOs) {
|
||||||
|
|
||||||
|
if (cashItemDO.getType() == 4) {
|
||||||
|
procureIds.add(cashItemDO.getProcureId());
|
||||||
|
}
|
||||||
|
}
|
||||||
//报销类别为 采购费时
|
//报销类别为 采购费时
|
||||||
if (cash.getType() == 4) {
|
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||||
|
|
||||||
//所有关联的采购申请改为 已支付状态
|
//所有关联的采购申请改为 已支付状态
|
||||||
bpmOAProcureService.updatePayFlagByIds(
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
new BpmOAProcureListEditReqVO()
|
new BpmOAProcureListEditReqVO()
|
||||||
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
||||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
.setProcureIds(procureIds)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,16 +154,20 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||||
|
|
||||||
//判断是否有采购报销
|
//判断是否有采购报销
|
||||||
BpmOACashDO cash = getCash(id);
|
for (BpmOACashItemDO cashItemDO : cashItemDOs) {
|
||||||
|
|
||||||
|
if (cashItemDO.getType() == 4) {
|
||||||
|
procureIds.add(cashItemDO.getProcureId());
|
||||||
|
}
|
||||||
|
}
|
||||||
//报销类别为 采购费时
|
//报销类别为 采购费时
|
||||||
if (cash.getType() == 4) {
|
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||||
|
|
||||||
//所有关联的采购申请改为 未支付状态
|
//所有关联的采购申请改为 未支付状态
|
||||||
bpmOAProcureService.updatePayFlagByIds(
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
new BpmOAProcureListEditReqVO()
|
new BpmOAProcureListEditReqVO()
|
||||||
.setPayFlag(BpmOAProcureDO.FLAG_FALSE)
|
.setPayFlag(BpmOAProcureDO.FLAG_FALSE)
|
||||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
.setProcureIds(procureIds)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,4 +186,10 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
|
|
||||||
return cashMapper.selectById(id);
|
return cashMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BpmOACashItemDO> getCashItem(Long cashId) {
|
||||||
|
|
||||||
|
return cashItemMapper.selectList(BpmOACashItemDO::getCashId, cashId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.api.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||||
|
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.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
@Tag(name = "RPC 服务 - 银行卡")
|
||||||
|
public interface BankApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/bank";
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
@Operation(summary = "获得银行卡信息")
|
||||||
|
@Parameter(name = "bankId", description = "编号", example = "1", required = true)
|
||||||
|
CommonResult<BankRespDTO> getBank(@RequestParam("bankId") Long bankId);
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.api.bank.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 - 银行卡 Response DTO")
|
||||||
|
@Data
|
||||||
|
public class BankRespDTO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡用户名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "开户行信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String bankName;
|
||||||
|
}
|
@ -70,4 +70,9 @@ public interface AdminUserApi {
|
|||||||
@PostMapping(PREFIX + "/create")
|
@PostMapping(PREFIX + "/create")
|
||||||
@Operation(summary = "创建用户")
|
@Operation(summary = "创建用户")
|
||||||
CommonResult<Long> createUser(@RequestBody UserSaveRespDTO saveRespDTO);
|
CommonResult<Long> createUser(@RequestBody UserSaveRespDTO saveRespDTO);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getUserIdsByUserNature")
|
||||||
|
@Operation(summary = "获取所有用户性质为外勤的用户")
|
||||||
|
@Parameter(name = "userNature", description = "用户性质", example = "3", required = true)
|
||||||
|
CommonResult<List<Long>> getUserIdsByUserNature(@RequestParam("userNature") Integer userNature);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.api.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.bank.UserBankService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
|
@Validated
|
||||||
|
public class BankApiImpl implements BankApi{
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserBankService userBankService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<BankRespDTO> getBank(Long bankId) {
|
||||||
|
|
||||||
|
BankDO bankDO = userBankService.getBank(bankId);
|
||||||
|
return success(BeanUtils.toBean(bankDO, BankRespDTO.class));
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
|
||||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
@Validated
|
@Validated
|
||||||
@ -69,4 +70,11 @@ public class AdminUserApiImpl implements AdminUserApi {
|
|||||||
return success(userService.createUser(BeanUtils.toBean(saveRespDTO, UserSaveReqVO.class)));
|
return success(userService.createUser(BeanUtils.toBean(saveRespDTO, UserSaveReqVO.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<Long>> getUserIdsByUserNature(Integer userNature) {
|
||||||
|
|
||||||
|
List<AdminUserDO> userDOS = userService.getListByNature(userNature);
|
||||||
|
return success(convertList(userDOS, AdminUserDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,13 @@ public class AdminUserDO extends TenantBaseDO {
|
|||||||
* 1:公司用户 2:工厂用户
|
* 1:公司用户 2:工厂用户
|
||||||
*/
|
*/
|
||||||
private Integer userType;
|
private Integer userType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户性质
|
||||||
|
* 3:正式 4:外勤
|
||||||
|
*/
|
||||||
|
private Integer userNature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后登录IP
|
* 最后登录IP
|
||||||
*/
|
*/
|
||||||
|
@ -317,4 +317,10 @@ public interface AdminUserService {
|
|||||||
*/
|
*/
|
||||||
IPage<UserSimpleRespVO> getAllUserListByGroupIds(UserPageDTO dto);
|
IPage<UserSimpleRespVO> getAllUserListByGroupIds(UserPageDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指令性质得用户列表
|
||||||
|
* @param userNature 用户性质
|
||||||
|
* @return 用户列表
|
||||||
|
*/
|
||||||
|
List<AdminUserDO> getListByNature(Integer userNature);
|
||||||
}
|
}
|
||||||
|
@ -624,4 +624,10 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
return userMapper.getAllUserListByGroupIds(MyBatisUtils.buildPage(dto), dto);
|
return userMapper.getAllUserListByGroupIds(MyBatisUtils.buildPage(dto), dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AdminUserDO> getListByNature(Integer userNature) {
|
||||||
|
|
||||||
|
return userMapper.selectList(AdminUserDO::getUserNature, userNature);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user