Merge remote-tracking branch 'origin/master'
commit
b2c95c67ed
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.cloud.market.controller;
|
package com.muyu.cloud.market.controller;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.api.naming.pojo.healthcheck.impl.Http;
|
||||||
import com.dtflys.forest.springboot.annotation.ForestScannerRegister;
|
import com.dtflys.forest.springboot.annotation.ForestScannerRegister;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.cloud.market.domin.Orders;
|
import com.muyu.cloud.market.domin.Orders;
|
||||||
|
@ -118,16 +119,27 @@ public class OrdersController {
|
||||||
}
|
}
|
||||||
|
|
||||||
//导出
|
//导出
|
||||||
@RequestMapping("/getOutAll")
|
@GetMapping("/getOutAll")
|
||||||
public void getOutAll(@Validated @RequestBody HttpServletResponse response){
|
public void gatOutAll(HttpServletResponse response){
|
||||||
//创建工具类对象
|
//创建工具类对象
|
||||||
|
ExcelUtil<Orders> excelUtil =new ExcelUtil<>(Orders.class);
|
||||||
|
//去数据库查询要导出来的数据
|
||||||
|
List<Orders> outAll = orderShowService.getOutAll();
|
||||||
|
|
||||||
|
excelUtil.exportExcel(response,outAll ,"订单信息表");
|
||||||
|
}
|
||||||
|
|
||||||
|
//选中导出
|
||||||
|
@GetMapping("/getseleOut")
|
||||||
|
public void selectOut (HttpServletResponse response,Integer[] ids){
|
||||||
|
//创建
|
||||||
ExcelUtil<Orders> excelUtil = new ExcelUtil<>(Orders.class);
|
ExcelUtil<Orders> excelUtil = new ExcelUtil<>(Orders.class);
|
||||||
//去数据库查询要导出来的数据
|
//去数据库查询要导出来的数据
|
||||||
List<Orders> list = orderShowService.getOutAll();
|
List<Orders> list = orderShowService.getseleOut(ids);
|
||||||
//调用工具类导出的方法
|
|
||||||
excelUtil.exportExcel(response,list,"订单信息表");
|
excelUtil.exportExcel(response,list,"订单信息选中导出");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,9 +77,7 @@ public interface OrderShowMapper {
|
||||||
//导出
|
//导出
|
||||||
List<Orders> getOutAll();
|
List<Orders> getOutAll();
|
||||||
//选中导出
|
//选中导出
|
||||||
List<Orders> getseleOut(@Param("ids") Integer[] ids);
|
List<Orders> getSeleOut(@Param("ids") Integer[] ids);
|
||||||
//搜索导出
|
|
||||||
List<OrdersListReq> getsearOut(@Param("empName") String empName);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -79,5 +79,6 @@ public interface OrderShowService {
|
||||||
*/
|
*/
|
||||||
List<Orders> getOutAll();
|
List<Orders> getOutAll();
|
||||||
|
|
||||||
|
List<Orders> getseleOut(Integer[] ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,11 @@ public class OrderShowServiceImpl implements OrderShowService {
|
||||||
return orderShowMapper.getOutAll();
|
return orderShowMapper.getOutAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Orders> getseleOut(Integer[] ids) {
|
||||||
|
return orderShowMapper.getSeleOut(ids);
|
||||||
|
}
|
||||||
|
|
||||||
public Orders selectByOrderNo(String ordersNum) {
|
public Orders selectByOrderNo(String ordersNum) {
|
||||||
return orderShowMapper.selectByordersNum(ordersNum);
|
return orderShowMapper.selectByordersNum(ordersNum);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,12 +95,43 @@
|
||||||
|
|
||||||
<!-- 普通导出(测试版) -->
|
<!-- 普通导出(测试版) -->
|
||||||
<select id="getOutAll" resultType="com.muyu.cloud.market.domin.Orders">
|
<select id="getOutAll" resultType="com.muyu.cloud.market.domin.Orders">
|
||||||
SELECT orders_id, orders_num, product_name, user_name, orders_price, orders_specification, orders_state, orders_launchdate,
|
SELECT
|
||||||
|
orders_id,
|
||||||
|
orders_num,
|
||||||
|
product_name,
|
||||||
|
user_name,
|
||||||
|
orders_price,
|
||||||
|
orders_specification,
|
||||||
|
orders_state,
|
||||||
|
orders_launchdate
|
||||||
FROM `orders`
|
FROM `orders`
|
||||||
LEFT JOIN `product` ON `orders`.orders_product = `product`.product_id
|
LEFT JOIN `product` ON `orders`.orders_product = `product`.product_id
|
||||||
LEFT JOIN `sys_user` ON `orders`.orders_user = `sys_user`.user_id
|
LEFT JOIN `sys_user` ON `orders`.orders_user =`sys_user`.sys_user_id
|
||||||
ORDER BY orders_launchdate DESC
|
ORDER BY orders_launchdate DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!--选中测试导出-->
|
||||||
|
<select id="getSeleOut" resultType="com.muyu.cloud.market.domin.Orders">
|
||||||
|
SELECT
|
||||||
|
orders_id,
|
||||||
|
orders_num,
|
||||||
|
orders_name,
|
||||||
|
user_name,
|
||||||
|
order_price,
|
||||||
|
orders_specification,
|
||||||
|
orders_state,
|
||||||
|
orders_launchdate
|
||||||
|
FROM `orders`
|
||||||
|
LEFT JOIN `product` ON `orders`.orders_product = `product`.product_id
|
||||||
|
LEFT JOIN `sys_user` ON `orders`.orders_user =`sys_user`.sys_user_id
|
||||||
|
WHERE
|
||||||
|
`orders`.ordersId in (
|
||||||
|
<foreach collection="ids" item="ordersId" separator=",">
|
||||||
|
#{ordersId}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue