fix:奖项类型申请提交

dev
wangxy 12 months ago
parent 052fa1655c
commit 7cf9595bb2

@ -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<RewFileRelation> list = relationService.lambdaQuery().eq(RewFileRelation::getApplyId, applyId).list();
List<FileRelationVO> fileRelationVOList = Convert.toList(FileRelationVO.class, list);
if(CollUtil.isNotEmpty(fileRelationVOList)){
applyInfoListVO.setFileRelationVOList(fileRelationVOList);
}
return applyInfoListVO;
}
}

@ -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));
}

@ -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<FileRelationVO> fileRelationVOList;

@ -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;
/**
* 12
*/
private Integer fileState;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
Loading…
Cancel
Save