解决数组越界
This commit is contained in:
@@ -160,9 +160,18 @@ public class QueryHelp {
|
||||
list.add(cb.isNull(getExpression(attributeName,join,root)));
|
||||
break;
|
||||
case BETWEEN:
|
||||
List<Object> between = new ArrayList<>((List<Object>)val);
|
||||
list.add(cb.between(getExpression(attributeName, join, root).as((Class<? extends Comparable>) between.get(0).getClass()),
|
||||
(Comparable) between.get(0), (Comparable) between.get(1)));
|
||||
if (val instanceof List) {
|
||||
List<?> betweenList = (List<?>) val;
|
||||
// 确保列表不为空且包含两个元素
|
||||
if (betweenList.size() == 2) {
|
||||
// 进行类型转换并执行 BETWEEN 查询
|
||||
List<Object> between = new ArrayList<>(betweenList);
|
||||
list.add(cb.between(
|
||||
getExpression(attributeName, join, root).as((Class<? extends Comparable>) between.get(0).getClass()),
|
||||
(Comparable) between.get(0),
|
||||
(Comparable) between.get(1)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ public class TbProductStockDetailController {
|
||||
@PostMapping("/stock")
|
||||
@Log("查询/product/Stock")
|
||||
@ApiOperation("查询/product/Stock")
|
||||
// @PreAuthorize("@el.check('tbProductStockDetail:list')")
|
||||
public ResponseEntity<Object> queryPage(@RequestBody TbProductStockDetailQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbProductStockDetailService.queryPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ public class TbProductServiceImpl implements TbProductService {
|
||||
tbProductVo.setGroupSnap(ListUtil.stringChangeList(tbProduct.getGroupSnap()));
|
||||
}
|
||||
BeanUtils.copyProperties(tbProduct, tbProductVo);
|
||||
tbProductVo.setImages(ListUtil.stringChangeStringList(tbProduct.getImages()));
|
||||
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user