fix:奖项评分提交

dev
wangxy 12 months ago
parent 49c8857de1
commit 18c28a8974

@ -0,0 +1,61 @@
package com.hyp.web.controller.manager;
import cn.hutool.core.io.FileUtil;
import com.hyp.common.exception.ServiceException;
import com.hyp.system.domain.RewFileRelation;
import com.hyp.system.service.RewFileRelationService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Objects;
/**
* packageName com.hyp.web.controller.manager
*
* @author wangxy
* @version JDK 8
* @className FileRelationManager
* @date 2024/4/12
* @description
*/
@Component
public class FileRelationManager {
@Resource
private RewFileRelationService fileRelationService;
/**
*
*
* @return boolean
*/
public boolean delFile(String fileId){
RewFileRelation fileRelation = fileRelationService.getById(fileId);
if(Objects.isNull(fileRelation)){
throw new ServiceException("文件不存在");
}
FileUtil.del(fileRelation.getFilePath());
return fileRelationService.removeById(fileId);
}
/**
*
*
* @param applyId
* @param fileCode
* @param fileState
* @return boolean
*/
public boolean filePass( String applyId, String fileCode, Integer fileState){
return fileRelationService.lambdaUpdate()
.eq(RewFileRelation::getApplyId,applyId)
.eq(RewFileRelation::getFileCode,fileCode)
.set(RewFileRelation::getFileState,fileState)
.update();
}
}

@ -0,0 +1,50 @@
package com.hyp.web.controller.reward;
import com.hyp.common.core.controller.BaseController;
import com.hyp.common.core.domain.AjaxResult;
import com.hyp.web.controller.manager.FileRelationManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* packageName com.hyp.web.controller.reward
*
* @author wangxy
* @version JDK 8
* @className FileRelationController
* @date 2024/4/12
* @description
*/
@Api("文件")
@RestController
@RequestMapping("/reward/file")
public class FileRelationController extends BaseController {
@Resource
private FileRelationManager fileRelationManager;
@ApiOperation("材料删除")
@GetMapping("/delFile/{fileId}")
public AjaxResult delFile(@PathVariable String fileId){
return toAjax(fileRelationManager.delFile(fileId));
}
@ApiOperation("材料审核")
@GetMapping("/filePass")
public AjaxResult filePass(@RequestParam String applyId,
@RequestParam String fileCode,
@RequestParam Integer fileState){
return toAjax(fileRelationManager.filePass(applyId,fileCode,fileState));
}
}

@ -10,6 +10,7 @@ import lombok.experimental.Accessors;
/**
*
* @author wangxy
* @TableName rew_file_relation
*/
@Data
@ -20,7 +21,7 @@ public class RewFileRelation implements Serializable {
*
*/
@TableId(type = IdType.ASSIGN_UUID)
private String id;
private String fileId;
/**
* id

@ -5,7 +5,7 @@
<mapper namespace="com.hyp.system.mapper.RewFileRelationMapper">
<resultMap id="BaseResultMap" type="com.hyp.system.domain.RewFileRelation">
<id property="id" column="id" jdbcType="VARCHAR"/>
<id property="fileId" column="file_id" jdbcType="VARCHAR"/>
<result property="applyId" column="apply_id" jdbcType="VARCHAR"/>
<result property="fileName" column="file_name" jdbcType="VARCHAR"/>
<result property="fileCode" column="file_code" jdbcType="VARCHAR"/>
@ -15,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
id,apply_id,file_name,
file_id,apply_id,file_name,
file_code,file_path,real_name,
file_state
</sql>

Loading…
Cancel
Save