|
|
@ -1,6 +1,7 @@ |
|
|
package com.gaotao.modules.pallet.service.impl; |
|
|
package com.gaotao.modules.pallet.service.impl; |
|
|
|
|
|
|
|
|
import cn.idev.excel.FastExcel; |
|
|
import cn.idev.excel.FastExcel; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -33,7 +34,9 @@ public class CatchPalletServiceImpl extends ServiceImpl<CatchPalletMapper, Catch |
|
|
public void export(HttpServletResponse response, CatchPallet pallet) { |
|
|
public void export(HttpServletResponse response, CatchPallet pallet) { |
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
response.setCharacterEncoding("utf-8"); |
|
|
response.setCharacterEncoding("utf-8"); |
|
|
List<CatchPallet> list = list(new QueryWrapper<>(pallet)); |
|
|
|
|
|
|
|
|
LambdaQueryWrapper<CatchPallet> queryWrapper = new LambdaQueryWrapper<>(pallet); |
|
|
|
|
|
queryWrapper.orderByDesc(CatchPallet::getId); |
|
|
|
|
|
List<CatchPallet> list = list(queryWrapper); |
|
|
if (list.isEmpty()) { |
|
|
if (list.isEmpty()) { |
|
|
throw new RuntimeException("not find any Pallet Label"); |
|
|
throw new RuntimeException("not find any Pallet Label"); |
|
|
} |
|
|
} |
|
|
@ -61,7 +64,7 @@ public class CatchPalletServiceImpl extends ServiceImpl<CatchPalletMapper, Catch |
|
|
.eq(Pallet::getPalletNo, pallet.getPalletNo().trim()) |
|
|
.eq(Pallet::getPalletNo, pallet.getPalletNo().trim()) |
|
|
.list(); |
|
|
.list(); |
|
|
if (list.isEmpty()){ |
|
|
if (list.isEmpty()){ |
|
|
throw new RuntimeException("no Pallet Label found "+pallet.getPalletNo().trim()); |
|
|
|
|
|
|
|
|
throw new RuntimeException("no Pallet Label found \""+pallet.getPalletNo().trim()+"\""); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int count = lambdaQuery() |
|
|
int count = lambdaQuery() |
|
|
|