From 7cf9595bb27e6a4ceb74f8828fbb61c65908e63e Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 11 Apr 2024 15:54:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A5=96=E9=A1=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/ApplyInfoListManager.java | 23 ++++++++ .../controller/reward/ApplyController.java | 15 +++-- .../hyp/system/domain/vo/ApplyInfoListVO.java | 7 +++ .../hyp/system/domain/vo/FileRelationVO.java | 57 +++++++++++++++++++ 4 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 hyp-system/src/main/java/com/hyp/system/domain/vo/FileRelationVO.java diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/manager/ApplyInfoListManager.java b/hyp-admin/src/main/java/com/hyp/web/controller/manager/ApplyInfoListManager.java index 7d7728a..462b593 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/manager/ApplyInfoListManager.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/manager/ApplyInfoListManager.java @@ -10,6 +10,7 @@ import com.hyp.system.domain.RewFileRelation; import com.hyp.system.domain.dto.ApplyInfoListDTO; import com.hyp.system.domain.dto.ApplyInfoListSaveDTO; import com.hyp.system.domain.vo.ApplyInfoListVO; +import com.hyp.system.domain.vo.FileRelationVO; import com.hyp.system.service.ISysDictDataService; import com.hyp.system.service.RewApplyInfoListService; import com.hyp.system.service.RewFileRelationService; @@ -100,10 +101,12 @@ public class ApplyInfoListManager { */ @Transactional(rollbackFor = Exception.class) public boolean submit(ApplyInfoListSaveDTO applyInfoListSaveDTO){ + LoginUser loginUser = SecurityUtils.getLoginUser(); RewApplyInfoList applyInfoList = applyInfoListService.getById(applyInfoListSaveDTO.getApplyId()); if(Objects.nonNull(applyInfoList)){ applyInfoList.setApplyStatus(applyInfoListSaveDTO.getApplyStatus()); applyInfoList.setAppTime(new Date()); + applyInfoList.setCreateBy(loginUser.getUsername()); applyInfoList.setIsReward(applyInfoListSaveDTO.getIsReward()); } return applyInfoListService.saveOrUpdate(applyInfoList); @@ -125,6 +128,26 @@ public class ApplyInfoListManager { } + /** + * + * 查询详细 + * @param applyId + * @return com.hyp.system.domain.vo.ApplyInfoListVO + */ + + public ApplyInfoListVO detail(String applyId){ + RewApplyInfoList applyInfoList = applyInfoListService.getById(applyId); + ApplyInfoListVO applyInfoListVO = Convert.convert(ApplyInfoListVO.class, applyInfoList); + List list = relationService.lambdaQuery().eq(RewFileRelation::getApplyId, applyId).list(); + List fileRelationVOList = Convert.toList(FileRelationVO.class, list); + if(CollUtil.isNotEmpty(fileRelationVOList)){ + applyInfoListVO.setFileRelationVOList(fileRelationVOList); + } + return applyInfoListVO; + + } + + } diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/reward/ApplyController.java b/hyp-admin/src/main/java/com/hyp/web/controller/reward/ApplyController.java index 561cf4a..0117c13 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/reward/ApplyController.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/reward/ApplyController.java @@ -49,27 +49,30 @@ public class ApplyController extends BaseController { @PreAuthorize("@ss.hasPermi('reward:apply:add')") @Log(title = "申请保存", businessType = BusinessType.INSERT) @GetMapping(value = "/getApplyId") - public AjaxResult getApplyId(@RequestParam String applyType) - { + public AjaxResult getApplyId(@RequestParam String applyType) { return success(applyInfoListManager.getApplyId(applyType)); } @ApiOperation("提交申请") @Log(title = "提交申请", businessType = BusinessType.UPDATE) @PostMapping("/submit") - public AjaxResult submit(@Validated @RequestBody ApplyInfoListSaveDTO applyInfoSaveDTO) - { + public AjaxResult submit(@Validated @RequestBody ApplyInfoListSaveDTO applyInfoSaveDTO) { return toAjax(applyInfoListManager.submit(applyInfoSaveDTO)); } @ApiOperation("删除申请") @Log(title = "删除申请", businessType = BusinessType.DELETE) @DeleteMapping("/delete/{applyId}") - public AjaxResult delete(@PathVariable String applyId) - { + public AjaxResult delete(@PathVariable String applyId) { return toAjax(applyInfoListManager.deleteById(applyId)); } + @ApiOperation("申请详细") + @GetMapping(value = "/detail/{applyId}") + public AjaxResult detail(@PathVariable String applyId) { + return success(applyInfoListManager.detail(applyId)); + } + diff --git a/hyp-system/src/main/java/com/hyp/system/domain/vo/ApplyInfoListVO.java b/hyp-system/src/main/java/com/hyp/system/domain/vo/ApplyInfoListVO.java index 7271782..301a5d9 100644 --- a/hyp-system/src/main/java/com/hyp/system/domain/vo/ApplyInfoListVO.java +++ b/hyp-system/src/main/java/com/hyp/system/domain/vo/ApplyInfoListVO.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.util.Date; +import java.util.List; /** * 奖项申请流程表 @@ -67,6 +68,12 @@ public class ApplyInfoListVO extends BaseEntity { private String createId; + /** + * 文件集合 + */ + private List fileRelationVOList; + + diff --git a/hyp-system/src/main/java/com/hyp/system/domain/vo/FileRelationVO.java b/hyp-system/src/main/java/com/hyp/system/domain/vo/FileRelationVO.java new file mode 100644 index 0000000..dbb95c5 --- /dev/null +++ b/hyp-system/src/main/java/com/hyp/system/domain/vo/FileRelationVO.java @@ -0,0 +1,57 @@ +package com.hyp.system.domain.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 奖项文件表 + * @TableName rew_file_relation + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class FileRelationVO implements Serializable { + /** + * 主键 + */ + private String id; + + /** + * 申请表id + */ + private String applyId; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 文件类型 + */ + private String fileCode; + + /** + * 文件路劲 + */ + private String filePath; + + /** + * 文件原有名称 + */ + private String realName; + + /** + * 文件核准状态(1:通过2:不通过) + */ + private Integer fileState; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file