申购车不需要出attr

This commit is contained in:
wangliwen 2022-06-03 10:02:39 +08:00
parent 4534c3d090
commit df2890cf4e
2 changed files with 35 additions and 36 deletions

View File

@ -2,7 +2,6 @@ package io.renren.modules.resourceCar.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.resource.service.ResourceService;
@ -82,7 +81,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
List<ResourceCarDTO> resourceCarDTOS = resourceCarDao.selectPageWithResource(params, (pageNum - 1) * pageSize, pageSize);
resourceCarDTOS.forEach(item -> {
//TODO:不需带attr属性数据
item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId()));
item.setResourceDTO(resourceService.get(item.getResourceId()));
});
List<ResourceCarDTO> resourceCarDTOSs = resourceCarDao.selectPageWithResource(params, 0, 100000);
page.setRecords(resourceCarDTOS);

View File

@ -36,14 +36,14 @@ import java.util.Map;
/**
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
* test
*
* @author Mark sunlightcs@gmail.com
* @since 3.0 2022-05-24
*/
@RestController
@RequestMapping("/taskList/tasklistcontroller")
@Api(tags="任务列表查询")
@Api(tags = "任务列表查询")
public class TaskListController {
@Autowired
private TaskListControllerService taskListControllerService;
@ -54,13 +54,13 @@ public class TaskListController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
})
@RequiresPermissions("taskList:tasklistcontroller:page")
public Result<PageData<TaskListControllerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
// @RequiresPermissions("taskList:tasklistcontroller:page")
public Result<PageData<TaskListControllerDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TaskListControllerDTO> page = taskListControllerService.page(params);
return new Result<PageData<TaskListControllerDTO>>().ok(page);
@ -70,42 +70,42 @@ public class TaskListController {
@GetMapping("/selectTaskList")
@ApiOperation("根据分页以及任务名称状态查询数据")
// @RequiresPermissions("taskList:tasklistcontroller:info")
public Map<String,Object> get(
@RequestParam(value = "taskName",required = false) String taskName,
@RequestParam(value = "taskStatus",required = false) Integer taskStatus,
@RequestParam(value = "page",required = true,defaultValue = "1") Integer page,
@RequestParam(value = "pageSize",required = true,defaultValue = "10") Integer pageSize
){
public Map<String, Object> get(
@RequestParam(value = "taskName", required = false) String taskName,
@RequestParam(value = "taskStatus", required = false) Integer taskStatus,
@RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
@RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize
) {
Page<TaskListControllerEntity> page1 = new Page<>(page,pageSize);
Page<TaskListControllerEntity> page1 = new Page<>(page, pageSize);
QueryWrapper<TaskListControllerEntity> queryWrapper = new QueryWrapper<>();
if (taskName!=null){
if (taskName != null) {
if (!StringUtils.isEmpty(taskName)) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
queryWrapper.like("task_name",taskName);
queryWrapper.like("task_name", taskName);
}
}
if (taskStatus!=null){
if (taskStatus != null) {
if (!StringUtils.isEmpty(taskStatus.toString())) {
//构建条件
//第一个为字段名称第二个值为模糊查询传递的值
queryWrapper.eq("task_status",taskStatus);
queryWrapper.eq("task_status", taskStatus);
}
}
taskListControllerDao.selectPage(page1,queryWrapper);
taskListControllerDao.selectPage(page1, queryWrapper);
List<TaskListControllerEntity> taskEntityList = page1.getRecords();
long num = page1.getTotal();
Map<String,Object> map = new HashMap<>();
if (taskEntityList.size()>0){
map.put("msg",200);//查询成功
map.put("taskEntityList",taskEntityList);
map.put("num",num);
}else {
map.put("msg",501);//查询失败
Map<String, Object> map = new HashMap<>();
if (taskEntityList.size() > 0) {
map.put("msg", 200);//查询成功
map.put("taskEntityList", taskEntityList);
map.put("num", num);
} else {
map.put("msg", 501);//查询失败
}
return map;
}
@ -115,7 +115,7 @@ public class TaskListController {
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("taskList:tasklistcontroller:save")
public Result save(@RequestBody TaskListControllerDTO dto){
public Result save(@RequestBody TaskListControllerDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -128,7 +128,7 @@ public class TaskListController {
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("taskList:tasklistcontroller:update")
public Result update(@RequestBody TaskListControllerDTO dto){
public Result update(@RequestBody TaskListControllerDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -141,7 +141,7 @@ public class TaskListController {
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("taskList:tasklistcontroller:delete")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");