加申购车参数校验

This commit is contained in:
dinggang 2022-04-22 10:10:58 +08:00
parent dcb415763e
commit 53a4af2bb8
2 changed files with 14 additions and 7 deletions

View File

@ -3,7 +3,6 @@ package io.renren.modules.resource.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.renren.common.annotation.LogOperation; import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant; import io.renren.common.constant.Constant;
import io.renren.common.controller.FileUploadController;
import io.renren.common.page.PageData; import io.renren.common.page.PageData;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.ValidatorUtils;
@ -27,9 +26,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.UUID;
/** /**
* 资源表 * 资源表
@ -43,7 +40,8 @@ import java.util.UUID;
public class ResourceController { public class ResourceController {
@Value("${resource.devModelFilePath}") @Value("${resource.devModelFilePath}")
private String delModelFilePath; private String devModelFilePath;
@Autowired @Autowired
private ResourceService resourceService; private ResourceService resourceService;
@ -157,7 +155,7 @@ public class ResourceController {
public Result upload(@RequestParam("file") MultipartFile uploadFile, public Result upload(@RequestParam("file") MultipartFile uploadFile,
HttpServletRequest request) { HttpServletRequest request) {
logger.info("上传文件:" + uploadFile.getOriginalFilename()); logger.info("上传文件:" + uploadFile.getOriginalFilename());
File folder = new File(delModelFilePath); File folder = new File(devModelFilePath);
if (!folder.isDirectory()) { if (!folder.isDirectory()) {
folder.mkdirs(); folder.mkdirs();
} }
@ -181,7 +179,8 @@ public class ResourceController {
} }
} }
/*@GetMapping("export") /*
@GetMapping("export")
@ApiOperation("导出") @ApiOperation("导出")
@LogOperation("导出") @LogOperation("导出")
//@RequiresPermissions("resource:resource:export") //@RequiresPermissions("resource:resource:export")

View File

@ -17,6 +17,8 @@ import io.renren.modules.resource.entity.ResourceEntity;
import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail; import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.service.SysDeptService;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -48,6 +50,8 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
private String delModelFilePath; private String delModelFilePath;
@Value("${resource.root_url}") @Value("${resource.root_url}")
private String root_url; private String root_url;
@Autowired
private SysDeptService sysDeptService;
@Autowired @Autowired
private ResourceDao resourceDao; private ResourceDao resourceDao;
@ -113,6 +117,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
ResourceDTO resourceDTO = new ResourceDTO(); ResourceDTO resourceDTO = new ResourceDTO();
ResourceEntity resourceEntity = resourceDao.selectById(id); ResourceEntity resourceEntity = resourceDao.selectById(id);
BeanUtils.copyProperties(resourceEntity, resourceDTO); BeanUtils.copyProperties(resourceEntity, resourceDTO);
SysDeptDTO data = sysDeptService.get(resourceDTO.getDeptId());
if (ObjectUtil.isNotNull(data)) {
resourceDTO.setNote1(data.getName());
}
QueryWrapper<AttrEntity> wrapper = new QueryWrapper<>(); QueryWrapper<AttrEntity> wrapper = new QueryWrapper<>();
wrapper.eq("data_resource_id", resourceEntity.getId()) wrapper.eq("data_resource_id", resourceEntity.getId())
.eq("del_flag", 0); .eq("del_flag", 0);