From e235d483194ab95bf62d1cfd343a172ff12781e8 Mon Sep 17 00:00:00 2001 From: pang.jiabao <pang_jiabao@163.com> Date: 星期六, 13 四月 2024 14:58:24 +0800 Subject: [PATCH] 聚乳酸库存明细 1.批号与包号排序需同步,增加水分,挥发段,分解段搜索,按照最大最小范围,包装类型跟托盘类型增加删选功能。 2.已经出库的物料,在明细表里面隐藏掉,但是数据保留。 3.增加二个跟聚乳酸一样的明细表,分改性树脂,纯树脂库存明细表,所有功能跟总的聚乳酸库存明细表一样 4.明细表整体框架调整一下,相对压缩一下,搜索功能框看看能否弄成二行 5.表里面的包装类型与托盘类型这些不主要的信息放到指标后面 6.关于分包再处理,举例原有系统里面销售选定的10包物料,再二次重新弄后,车间打印新标签,使用新的包号,在明细表里面体现原有所有指标信息及批号,包号,牌号跟新的关联 7.出库时候时间可选历史,不要就只能出现4天 8.提取库存里面需要有最大包号跟最小包号选择 --- src/main/java/com/zy/common/web/FileController.java | 63 +++++++++++++++++-------------- 1 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/zy/common/web/FileController.java b/src/main/java/com/zy/common/web/FileController.java index d7b9c83..cff077b 100644 --- a/src/main/java/com/zy/common/web/FileController.java +++ b/src/main/java/com/zy/common/web/FileController.java @@ -1,47 +1,52 @@ package com.zy.common.web; -import com.alibaba.excel.EasyExcel; +import com.core.common.BaseRes; +import com.core.common.Cools; import com.core.common.R; -import com.zy.common.utils.excel.ExcelUtils; -import com.zy.common.utils.excel.matcode.MatCodeExcel; -import com.zy.common.utils.excel.matcode.MatCodeExcelListener; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; +import com.zy.common.config.AdminInterceptor; +import com.zy.common.utils.BarcodeUtils; +import com.zy.common.utils.QrCode; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; import java.io.IOException; -import java.net.URLEncoder; /** * todo * Created by vincent on 2019-11-25 */ @RestController -@RequestMapping("excel/") +@RequestMapping("file/") public class FileController { - /** - * 鏂囦欢涓婁紶 - */ - @PostMapping("upload") - @ResponseBody - public R upload(MultipartFile file) throws IOException { - EasyExcel.read(file.getInputStream(), MatCodeExcel.class, new MatCodeExcelListener()).sheet().doRead(); + + @RequestMapping(value = "/barcode/qrcode/auth") +// @ManagerAuth(memo = "鍟嗗搧缂栧彿鏉″舰鐮佽幏鍙�(type:1(鏉″舰鐮�);2(浜岀淮鐮�)") + public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type + , @RequestParam String param + , @RequestParam(required = false) Integer width + , @RequestParam(required = false) Integer height + , HttpServletResponse response) throws Exception { + AdminInterceptor.cors(response); + if (Cools.isEmpty(param)){ + return R.parse(BaseRes.EMPTY); + } + BufferedImage img; + if (type == 1) { + img = BarcodeUtils.encode(param, width, height); + } else { + img = QrCode.createImg(param, width, height); + } + if (!ImageIO.write(img, "jpg", response.getOutputStream())) { + throw new IOException("Could not write an image of format jpg"); + } + response.getOutputStream().flush(); + response.getOutputStream().close(); return R.ok(); - } - - /** - * 鏂囦欢涓嬭浇锛堝け璐ヤ簡浼氳繑鍥炰竴涓湁閮ㄥ垎鏁版嵁鐨凟xcel锛� - */ - @GetMapping("download") - public void download(HttpServletResponse response) throws IOException { - // 杩欓噷娉ㄦ剰 鏈夊悓瀛﹀弽搴斾娇鐢╯wagger 浼氬鑷村悇绉嶉棶棰橈紝璇风洿鎺ョ敤娴忚鍣ㄦ垨鑰呯敤postman - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf-8"); - // 杩欓噷URLEncoder.encode鍙互闃叉涓枃涔辩爜 褰撶劧鍜宔asyexcel娌℃湁鍏崇郴 - String fileName = URLEncoder.encode("娴嬭瘯", "UTF-8"); - response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); - EasyExcel.write(response.getOutputStream(), MatCodeExcel.class).sheet("妯℃澘").doWrite(ExcelUtils.data()); } } -- Gitblit v1.9.1