| | |
| | | import com.zy.asrs.common.domain.entity.LocInPrintMatExcel; |
| | | import com.zy.asrs.common.domain.entity.MatExcel; |
| | | import com.zy.asrs.common.domain.entity.MatPrint; |
| | | import com.zy.asrs.common.domain.entity.OutLocOrderExcel; |
| | | import com.zy.asrs.common.utils.*; |
| | | import com.zy.asrs.common.wms.entity.LocInPrintMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | |
| | | print.setMemo(mat.getMemo()); |
| | | |
| | | print.setMaterial(mat.getMaterial()); |
| | | print.setDecrees(mat.getDecrees()); |
| | | print.setDecrees(locInPrintMat.getDecrees()); |
| | | print.setImgNum(mat.getImgNum()); |
| | | print.setWeight(String.valueOf(mat.getWeight())); |
| | | print.setModel(mat.getModel()); |
| | |
| | | return R.ok("成功导入"+listener.getTotal()[0]+"种待打印物料信息,共生成"+listener.getTotal()[1]+"条待打印条码!"); |
| | | } |
| | | |
| | | /** |
| | | * excel导入模板下载 |
| | | */ |
| | | @RequestMapping(value = "/out/loc/box/excel/import/out/mould") |
| | | public void outLocBoxExcelImportOutMould(HttpServletResponse response) throws IOException { |
| | | List<OutLocOrderExcel> excels = new ArrayList<>(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("导入订单信息出库模板", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), OutLocOrderExcel.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .sheet("出库模板") |
| | | .doWrite(excels); |
| | | } |
| | | |
| | | // excel导入 |
| | | @PostMapping(value = "/out/loc/box/excel/import/out/auth") |
| | | @ManagerAuth(memo = "导入订单信息出库") |
| | | @Transactional |
| | | public R outLocBoxExcelImportOut(MultipartFile file) throws IOException { |
| | | OutLocOrderExcelListener listener = new OutLocOrderExcelListener(getUserId(), getHostId()); |
| | | EasyExcel.read(file.getInputStream(), OutLocOrderExcel.class, listener).sheet().doRead(); |
| | | return R.ok("成功导入"+listener.getTotal()[0]+"条订单明细!"); |
| | | } |
| | | |
| | | } |