Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into dev
# Conflicts: # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOACashService.java # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOACashServiceImpl.java # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
This commit is contained in:
commit
ded5669b21
@ -3,14 +3,8 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
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.convert.oa.BpmOACashConvert;
|
||||
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.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.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -19,11 +13,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
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.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
@ -41,12 +32,6 @@ public class BpmOACashController {
|
||||
@Resource
|
||||
private BpmOACashService cashService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
|
||||
@ -59,17 +44,8 @@ public class BpmOACashController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOACashRespVO> getCash(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOACashDO cash = cashService.getCash(id);
|
||||
BpmOACashDO cashDO = cashService.getCash(id);
|
||||
|
||||
// 获取明细数据
|
||||
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));
|
||||
return success(cashService.convertCash(cashDO));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
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.BpmOACashRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
|
||||
@ -49,4 +50,11 @@ public interface BpmOACashService {
|
||||
* @return
|
||||
*/
|
||||
BpmOACashDO getByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 转换现金支出详情 用于前端返回值
|
||||
* @param cash 现金支出对象
|
||||
* @return 现金支出对象
|
||||
*/
|
||||
BpmOACashRespVO convertCash(BpmOACashDO cash);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ 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.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.BpmOACashRespVO;
|
||||
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;
|
||||
@ -20,6 +21,10 @@ 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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 org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -34,6 +39,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_CASH_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@ -68,6 +74,12 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Override
|
||||
public Long createCash(Long userId, BpmOACashCreateReqVO createReqVO) {
|
||||
|
||||
@ -228,4 +240,22 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOACashRespVO convertCash(BpmOACashDO cash) {
|
||||
|
||||
// 获取明细数据
|
||||
List<BpmOACashItemDO> cashItemDOs = getCashItem(cash.getId());
|
||||
|
||||
//获取部门信息map
|
||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(cashItemDOs, BpmOACashItemDO::getDeptId));
|
||||
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankRespDTO = null;
|
||||
if (cash.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(cash.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
return BpmOACashConvert.INSTANCE.convert1(cash, cashItemDOs, deptMap, bankRespDTO);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user