|
|
|
@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
|
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
|
|
|
|
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
@ -49,6 +51,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
public class OrderGoodsController extends JeecgController<OrderGoods, IOrderGoodsService> { |
|
|
|
|
@Autowired |
|
|
|
|
private IOrderGoodsService orderGoodsService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyOrdersService zyOrdersService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
@ -65,11 +69,34 @@ public class OrderGoodsController extends JeecgController<OrderGoods, IOrderGood |
|
|
|
|
public Result<?> queryPageList(OrderGoods orderGoods, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapper = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize); |
|
|
|
|
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
HttpServletRequest req,@RequestParam(name="orderid",required=true)String orderid,@RequestParam(name="ischild",required=true)String ischild) { |
|
|
|
|
if(orderid.equals("undefined")&&ischild.equals("undefined")){ |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapper = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize); |
|
|
|
|
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
}else if(ischild.equals("0")){ |
|
|
|
|
ZyOrders zyOrders = new ZyOrders(); |
|
|
|
|
QueryWrapper<ZyOrders> queryWrapper1 = QueryGenerator.initQueryWrapper(zyOrders, req.getParameterMap()); |
|
|
|
|
queryWrapper1.eq("order_id",orderid); |
|
|
|
|
List<ZyOrders> list = zyOrdersService.list(queryWrapper1); |
|
|
|
|
String ids = ""; |
|
|
|
|
for (int i = 0 ; i < list.size() ; i++){ |
|
|
|
|
ids = ids + list.get(i).getId()+","; |
|
|
|
|
} |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapper2 = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
queryWrapper2.in("orders_id",ids.substring(0,ids.length()-1).split(",")); |
|
|
|
|
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize); |
|
|
|
|
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper2); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
}else { |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapper3 = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
queryWrapper3.eq("orders_id",orderid); |
|
|
|
|
Page<OrderGoods> page = new Page<OrderGoods>(pageNo, pageSize); |
|
|
|
|
IPage<OrderGoods> pageList = orderGoodsService.page(page, queryWrapper3); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|