删除修改时校验文件

master
Diyu0904 2025-03-21 09:17:58 +08:00
parent d0238c2320
commit 9b4f92beed
3 changed files with 31 additions and 33 deletions

View File

@ -2,7 +2,6 @@ package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
@ -97,21 +96,21 @@ public class MallProductController extends BaseController {
public AjaxResult updateModel(@RequestBody RequestModel requestModel) { public AjaxResult updateModel(@RequestBody RequestModel requestModel) {
for (ModelVersion modelVersion : requestModel.getModelVersionList()) { // for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
//
//校验名字 // //校验名字
ModelVersion modelVersion1 = modelVersionMapper.selectByFileName(modelVersion.getFileName()); // ModelVersion modelVersion1 = modelVersionMapper.selectByFileName(modelVersion.getFileName());
if (modelVersion1 != null) { // if (modelVersion1 != null) {
//
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件名字重复"); // return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
} // }
//校验hash // //校验hash
ModelVersion modelVersion2 = modelVersionMapper.selectByHash(modelVersion.getFileHash()); // ModelVersion modelVersion2 = modelVersionMapper.selectByHash(modelVersion.getFileHash());
if (modelVersion2 != null){ // if (modelVersion2 != null){
//
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件内容重复"); // return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
} // }
} // }
ModelProduct modelProduct = requestModel.getModelProduct(); ModelProduct modelProduct = requestModel.getModelProduct();

View File

@ -2,11 +2,9 @@ package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.WorkFlow;
import com.mcwl.resource.domain.WorkFlowVersion;
import com.mcwl.resource.domain.dto.AddRequestWorkFlow; import com.mcwl.resource.domain.dto.AddRequestWorkFlow;
import com.mcwl.resource.domain.request.RequestWorkFlow; import com.mcwl.resource.domain.request.RequestWorkFlow;
import com.mcwl.resource.domain.response.ResponseWorkFlow; import com.mcwl.resource.domain.response.ResponseWorkFlow;
@ -101,21 +99,21 @@ public class WorkFlowController extends BaseController {
public R<Object> updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow) { public R<Object> updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow) {
for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) { // for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
//
//校验名字 // //校验名字
WorkFlowVersion workFlowVersion1 = workFlowVersionMapper.selectByFileName(workFlowVersion.getFileName()); // WorkFlowVersion workFlowVersion1 = workFlowVersionMapper.selectByFileName(workFlowVersion.getFileName());
if (workFlowVersion1 != null) { // if (workFlowVersion1 != null) {
//
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复"); // return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
} // }
//校验hash // //校验hash
WorkFlowVersion workFlowVersion2 = workFlowVersionMapper.selectByHash(workFlowVersion.getFileHash()); // WorkFlowVersion workFlowVersion2 = workFlowVersionMapper.selectByHash(workFlowVersion.getFileHash());
if (workFlowVersion2 != null){ // if (workFlowVersion2 != null){
//
return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复"); // return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
} // }
} // }
workFlowService.updateWorkFlow(requestWorkFlow); workFlowService.updateWorkFlow(requestWorkFlow);

View File

@ -273,6 +273,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
//校验是否实名 //校验是否实名
SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId()); SysUser sysUser = sysUserService.selectUserInfoById(SecurityUtils.getUserId());
log.info("查询到的个人数据:{}",sysUser);
if (StringUtils.isEmpty(sysUser.getName())){ if (StringUtils.isEmpty(sysUser.getName())){
return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布"); return R.fail(HttpStatus.SHOW_ERROR_MSG,"实名制后才可以发布");