|
|
@@ -135,6 +135,8 @@ public class SyPackingListTailoringController implements Job {
|
|
|
String endDate,
|
|
|
HttpServletRequest req) {
|
|
|
QueryWrapper<SyPackingListTailoringVo> queryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<SyPackingListTailoringVo> queryWrapper2 = QueryGenerator.initQueryWrapper(syPackingListTailoringVo, req.getParameterMap());
|
|
|
+ System.out.println("排序 \t"+queryWrapper2.getExpression().getOrderBy());
|
|
|
Page<SyPackingListTailoringVo> page = new Page<SyPackingListTailoringVo>(pageNo, pageSize);
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
if(oConvertUtils.isNotEmpty(syPackingListTailoringVo.getOrderNumber())){
|
|
|
@@ -182,6 +184,29 @@ public class SyPackingListTailoringController implements Job {
|
|
|
queryWrapper.ge("a.is_Reference",syPackingListTailoringVo.getIsReference());//是否被参照
|
|
|
}
|
|
|
}
|
|
|
+// queryWrapper.groupBy("a.id");
|
|
|
+ if (oConvertUtils.isNotEmpty(syPackingListTailoringVo.getOrder())){
|
|
|
+ String[] sqlSegments=queryWrapper2.getExpression().getOrderBy().get(0).getSqlSegment().split(" ");
|
|
|
+ String column=sqlSegments[0];
|
|
|
+ String order=sqlSegments[1];
|
|
|
+// System.out.println("column\t"+column);
|
|
|
+// System.out.println("order\t"+order);
|
|
|
+ if (order.equals("ASC")){
|
|
|
+ if (column.equals("item_number")){
|
|
|
+ queryWrapper.orderByAsc("a."+column);
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByAsc("b."+column);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (column.equals("item_number")){
|
|
|
+ queryWrapper.orderByDesc("a."+column);
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByDesc("b."+column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByDesc("a.create_time");
|
|
|
+ }
|
|
|
page.setSearchCount(false);//不查询总数
|
|
|
IPage<SyPackingListTailoringVo> pageList = syPackingListTailoringService.selectList(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
@@ -595,6 +620,7 @@ public class SyPackingListTailoringController implements Job {
|
|
|
Page<SyPackingListTailoringVo> page = new Page<SyPackingListTailoringVo>(1, 10000);
|
|
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
+ QueryWrapper<SyPackingListTailoringVo> queryWrapper2 = QueryGenerator.initQueryWrapper(syPackingListTailoringVo, request.getParameterMap());
|
|
|
if(selectAll.equals("1")){
|
|
|
if(oConvertUtils.isNotEmpty(syPackingListTailoringVo.getOrderNumber())){
|
|
|
queryWrapper.like("a.order_number",syPackingListTailoringVo.getOrderNumber().trim());//查询订单号
|
|
|
@@ -641,6 +667,28 @@ public class SyPackingListTailoringController implements Job {
|
|
|
queryWrapper.ge("a.is_Reference",syPackingListTailoringVo.getIsReference());//是否被参照
|
|
|
}
|
|
|
}
|
|
|
+ if (oConvertUtils.isNotEmpty(syPackingListTailoringVo.getOrder())){
|
|
|
+ String[] sqlSegments=queryWrapper2.getExpression().getOrderBy().get(0).getSqlSegment().split(" ");
|
|
|
+ String column=sqlSegments[0];
|
|
|
+ String order=sqlSegments[1];
|
|
|
+// System.out.println("column\t"+column);
|
|
|
+// System.out.println("order\t"+order);
|
|
|
+ if (order.equals("ASC")){
|
|
|
+ if (column.equals("item_number")){
|
|
|
+ queryWrapper.orderByAsc("a."+column);
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByAsc("b."+column);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (column.equals("item_number")){
|
|
|
+ queryWrapper.orderByDesc("a."+column);
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByDesc("b."+column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ queryWrapper.orderByDesc("a.create_time");
|
|
|
+ }
|
|
|
}else{
|
|
|
queryWrapper.in("a.id",Arrays.asList(ids));//查询列表
|
|
|
}
|