| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.dto.asset.OaApprovalApplicationAssetReceiveDTO; |
| | | import com.ruoyi.system.query.OaApprovalApplicationAssetPageQuery; |
| | | import com.ruoyi.system.service.OaApprovalApplicationAssetService; |
| | | import com.ruoyi.system.vo.asset.OaApprovalApplicationAssetPageVO; |
| | | import com.ruoyi.system.vo.asset.OaApprovalApplicationAssetDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | oaApprovalApplicationAssetService.submitReceive(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("获取资产领用申请分页列表") |
| | | @PostMapping("/page-list") |
| | | public R<IPage<OaApprovalApplicationAssetPageVO>> getReceivePageList(@RequestBody OaApprovalApplicationAssetPageQuery pageQuery) { |
| | | // 数据权限:非管理员仅能查看本部门 |
| | | Long userId = SecurityUtils.getUserId(); |
| | | boolean isAdmin = SecurityUtils.isAdmin(userId); |
| | | if (!isAdmin) { |
| | | try { |
| | | pageQuery.setDeptId(Integer.valueOf(SecurityUtils.getDeptId())); |
| | | } catch (Exception e) { |
| | | // ignore parse, leave null if cannot parse |
| | | } |
| | | } |
| | | IPage<OaApprovalApplicationAssetPageVO> page = oaApprovalApplicationAssetService.getReceivePageList(pageQuery); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation("获取资产领用详情") |
| | | @GetMapping("/detail/receive/{id}") |
| | | public R<OaApprovalApplicationAssetDetailVO> getReceiveDetail(@PathVariable Integer id) { |
| | | OaApprovalApplicationAssetDetailVO detail = oaApprovalApplicationAssetService.getDetail(id); |
| | | return R.ok(detail); |
| | | } |
| | | |
| | | } |