Commit 2561c1b5 authored by duanruiming's avatar duanruiming

[udpate] 优化部分也异常处理,不分页逻辑

parent d21b45a8
...@@ -44,9 +44,11 @@ public class CrossInfoController { ...@@ -44,9 +44,11 @@ public class CrossInfoController {
public JsonViewObject list(@RequestBody CrossInfoListDTO crossInfoListDTO) { public JsonViewObject list(@RequestBody CrossInfoListDTO crossInfoListDTO) {
Integer pageNum = crossInfoListDTO.getPageNum(); Integer pageNum = crossInfoListDTO.getPageNum();
Integer pageSize = crossInfoListDTO.getPageSize(); Integer pageSize = crossInfoListDTO.getPageSize();
if (Objects.isNull(pageSize) || pageSize == 0 || Objects.isNull(pageNum) || pageNum == 0) { // 不分页
// 不分页 if (Objects.isNull(pageNum) || pageNum <= 0) {
crossInfoListDTO.setPageNum(1); crossInfoListDTO.setPageNum(1);
}
if (Objects.isNull(pageSize) || pageSize <= 0) {
crossInfoListDTO.setPageSize(9999); crossInfoListDTO.setPageSize(9999);
} }
PageInfo<CrossInfoListVO> crossInfoListOutVOPageInfo = crossInfoService.list(crossInfoListDTO); PageInfo<CrossInfoListVO> crossInfoListOutVOPageInfo = crossInfoService.list(crossInfoListDTO);
......
...@@ -5,21 +5,20 @@ import io.swagger.annotations.Api; ...@@ -5,21 +5,20 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerInsertOrUpdateDTO; import net.wanji.utc.dto.systemadmin.ManufacturerInsertOrUpdateDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.entity.JsonViewObject; import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.core.MediaType;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import javax.ws.rs.core.MediaType;
import java.util.Objects;
/** /**
* 系统管理-厂商管理 * 系统管理-厂商管理
...@@ -43,11 +42,13 @@ public class ManufacturerController { ...@@ -43,11 +42,13 @@ public class ManufacturerController {
@ApiResponse(code = 200, message = "OK", response = ManufacturerInfoPO.class), @ApiResponse(code = 200, message = "OK", response = ManufacturerInfoPO.class),
}) })
public JsonViewObject list(@RequestBody ManufacturerListDTO manufacturerListDTO) { public JsonViewObject list(@RequestBody ManufacturerListDTO manufacturerListDTO) {
Integer pageSize = manufacturerListDTO.getPageSize();
Integer pageNum = manufacturerListDTO.getPageNum(); Integer pageNum = manufacturerListDTO.getPageNum();
if (pageSize == 0 && pageNum == 0) { Integer pageSize = manufacturerListDTO.getPageSize();
// 不分页 // 不分页
if (Objects.isNull(pageNum) || pageNum <= 0) {
manufacturerListDTO.setPageNum(1); manufacturerListDTO.setPageNum(1);
}
if (Objects.isNull(pageSize) || pageSize <= 0) {
manufacturerListDTO.setPageSize(9999); manufacturerListDTO.setPageSize(9999);
} }
PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListDTO); PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment