diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java index 628b1737..6d7355b4 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java @@ -1824,4 +1824,26 @@ public class MaterialController { } + /** + * 用于修改对应的码值类型 + * @param map 参数 + * @return + */ + @PostMapping("updateQrCodeType") + public RestResponse updateQrCodeType(@RequestBody Map map){ + // 获取转换类型 + String type = (String) map.get("type"); + + int result = 0; + if("qTb".equals(type)){ + // 如果是二维码转条形码 + result = materialService.qrCodeToBarCode(map); + }else{ + // 如果是条形码转二维码 + result = materialService.barCodeToQrCode(map); + } + return CrudUtil.putHandle(1,result); + } + + } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 3805a94d..5393f1eb 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -1562,7 +1562,7 @@ public class PageController { } @GetMapping("applicationInForGroup") - public ModelAndView applicationInForGroup(Integer gid,String type){ + public ModelAndView applicationInForGroup(Integer gid, String type) { ModelAndView mv = new ModelAndView(); List gidList = new ArrayList<>(); if ("one".equals(type)) { @@ -2274,29 +2274,47 @@ public class PageController { @GetMapping("/printCode") - public ModelAndView printCode(int mid,int flag) { + public ModelAndView printCode(int mid, int flag) { ModelAndView mv = new ModelAndView(); - - if(flag == 1){ + mv.addObject("mcode", "noMaterial"); + mv.addObject("version", "noMaterial"); + if (flag == 1) { // 如果是物料 // 获取当前对应物料 Material materialById = materialService.findMaterialById(mid); // 获取当前物料对应的码值 String qrCodeByMcode = materialService.findQrCodeByMcode(materialById.getCode()); - mv.addObject("qrCode",qrCodeByMcode); - }else if(flag == 2){ + mv.addObject("qrCode", qrCodeByMcode); + mv.addObject("mcode", materialById.getCode()); + mv.addObject("name", materialById.getMname()); + if (materialById.getVersion() != null) { + mv.addObject("version", materialById.getVersion()); + } + } else if (flag == 2) { // 如果是仓库 + // 获取对应的仓库 + Depository depositoryById = depositoryService.findDepositoryById(mid); // 获取当前仓库对应的码值 String qrCodeByDepository = depositoryService.findQrCodeByDepository(mid); - mv.addObject("qrCode",qrCodeByDepository); - }else if(flag == 3){ + mv.addObject("qrCode", qrCodeByDepository); + mv.addObject("name", depositoryById.getDname()); + + } else if (flag == 3) { // 如果是库位 + // 获取对应库位 + Place placeById = placeService.findPlaceById(mid); + if (Integer.compare(0, placeById.getDid()) == 0) { + mv.addObject("name", "默认库位"); + } else { + Depository depositoryById = depositoryService.findDepositoryById(placeById.getDid()); + mv.addObject("name", depositoryById.getDname() + "-" + placeById.getCode()); + } // 获取当前库位对应的码值 String qrCodeByPlace = placeService.findQrCodeByPlace(mid); - mv.addObject("qrCode",qrCodeByPlace); + mv.addObject("qrCode", qrCodeByPlace); } mv.setViewName("pages/JcPrinter/PrinterIndex"); return mv; diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java index 837cfdb6..34309d50 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java @@ -370,4 +370,20 @@ public interface MaterialMapper { * @return */ MaterialAndProducedDate findMaterialAndProducedDateByMidAndProducedDate(Map map); + + + /** + * 根据物料编码与码值获取对应对象 + * @param map 查询条件 + * @return + */ + MaterialAndBarCode findMaterialAndBarCodeByQrCode(Map map); + + + /** + * 用于修改编码类型 + * @param map 修改数据 + * @return + */ + Integer updateQrCodeAndMaterial(Map map); } diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index da3c7426..623cdf85 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml @@ -576,6 +576,38 @@ group by mcode + + + + + + update qrcodeandmaterial + + + barCode = #{qrCode}, + + + mcode = #{mcode}, + + + flag = #{flag} + + + where id = #{id} + + + + +

刷新

SDK初始化
@@ -46,6 +49,13 @@
绘制二维码
+
+ 名称绘制 +
+
+ 型号绘制 +
+
@@ -87,7 +97,6 @@ - @@ -102,17 +111,18 @@
单页多份打印 - 多页多份打印 + 多页多份打印
+ - + - + @@ -140,6 +150,12 @@ + + + + + + @@ -170,14 +186,11 @@ - 此处不依据二维码类型校验二维码内容,可百度相关的条码类型输入符合要求的条码类型 - - - - - - - + + + + + @@ -188,12 +201,109 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 加粗 + 斜体 + 下划线 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 加粗 + 斜体 + 下划线 + + + + diff --git a/src/main/resources/templates/pages/material/material-out.html b/src/main/resources/templates/pages/material/material-out.html index e8f4b3b6..77a8bc0c 100644 --- a/src/main/resources/templates/pages/material/material-out.html +++ b/src/main/resources/templates/pages/material/material-out.html @@ -165,7 +165,7 @@ {field: 'shelfLife', width: 150, title: '保质期'}, {field: 'productionPlace', width: 150, title: '产地'}, {field: 'remark', width: 150, title: '备注'}, - {field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'}, + {field: 'state', title: '状态', minWidth: 100, templet: '#switchTpl'}, {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"} ] ], @@ -173,9 +173,6 @@ limit: 10, page: true, skin: 'line', - done: function () { - - } }); @@ -191,13 +188,13 @@ if (data.brand !== '') { req.brand = data.brand; } - if (data.materialTypeId != '') { + if (data.materialTypeId !== '') { req.materialTypeId = data.materialTypeId; } - if (data.state != '') { + if (data.state !== '') { req.state = data.state; } - if (data.code != '') { + if (data.code !== '') { req.code = data.code } diff --git a/src/main/resources/templates/pages/materialtype/materialTypeByParentId.html b/src/main/resources/templates/pages/materialtype/materialTypeByParentId.html index 51946237..bb21945f 100644 --- a/src/main/resources/templates/pages/materialtype/materialTypeByParentId.html +++ b/src/main/resources/templates/pages/materialtype/materialTypeByParentId.html @@ -50,6 +50,11 @@ + + diff --git a/src/main/resources/templates/pages/materialtype/materialType_view.html b/src/main/resources/templates/pages/materialtype/materialType_view.html index f26e8328..6a657bd0 100644 --- a/src/main/resources/templates/pages/materialtype/materialType_view.html +++ b/src/main/resources/templates/pages/materialtype/materialType_view.html @@ -120,11 +120,11 @@ {type: "checkbox", width: 50}, {field: 'tname', width: 120, title: '类型名称'}, {field: 'introduce', width: 200, title: '类型介绍'}, - {field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'}, + {title: '状态', width: 100, templet: '#switchTpl', align: "center"}, {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"} ] ], - limits: [10, 15, 20, 25, 50,100], + limits: [10, 15, 20, 25, 50, 100], limit: 10, page: true, skin: 'line', @@ -140,7 +140,7 @@ if (data.tname !== '') { req.tname = data.tname; } - if (data.state != '') { + if (data.state !== '') { req.state = data.state; } req.parentId = parentId; @@ -271,7 +271,7 @@ table.on('tool(currentTableFilter)', function (obj) { let data = obj.data; - + console.log(data) if (obj.event === 'detail') { req = {}; req.parentId = parentId; diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index da3c7426..623cdf85 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml @@ -576,6 +576,38 @@ group by mcode + + + + + + update qrcodeandmaterial + + + barCode = #{qrCode}, + + + mcode = #{mcode}, + + + flag = #{flag} + + + where id = #{id} + + + + +

刷新

SDK初始化
@@ -46,6 +49,13 @@
绘制二维码
+
+ 名称绘制 +
+
+ 型号绘制 +
+
@@ -87,7 +97,6 @@ - @@ -102,17 +111,18 @@
单页多份打印 - 多页多份打印 + 多页多份打印
+ - + - + @@ -140,6 +150,12 @@ + + + + + + @@ -170,14 +186,11 @@ - 此处不依据二维码类型校验二维码内容,可百度相关的条码类型输入符合要求的条码类型 - - - - - - - + + + + + @@ -188,12 +201,109 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 加粗 + 斜体 + 下划线 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 加粗 + 斜体 + 下划线 + + + + diff --git a/target/classes/templates/pages/material/material-out.html b/target/classes/templates/pages/material/material-out.html index e8f4b3b6..77a8bc0c 100644 --- a/target/classes/templates/pages/material/material-out.html +++ b/target/classes/templates/pages/material/material-out.html @@ -165,7 +165,7 @@ {field: 'shelfLife', width: 150, title: '保质期'}, {field: 'productionPlace', width: 150, title: '产地'}, {field: 'remark', width: 150, title: '备注'}, - {field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'}, + {field: 'state', title: '状态', minWidth: 100, templet: '#switchTpl'}, {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"} ] ], @@ -173,9 +173,6 @@ limit: 10, page: true, skin: 'line', - done: function () { - - } }); @@ -191,13 +188,13 @@ if (data.brand !== '') { req.brand = data.brand; } - if (data.materialTypeId != '') { + if (data.materialTypeId !== '') { req.materialTypeId = data.materialTypeId; } - if (data.state != '') { + if (data.state !== '') { req.state = data.state; } - if (data.code != '') { + if (data.code !== '') { req.code = data.code } diff --git a/target/classes/templates/pages/materialtype/materialTypeByParentId.html b/target/classes/templates/pages/materialtype/materialTypeByParentId.html index 51946237..bb21945f 100644 --- a/target/classes/templates/pages/materialtype/materialTypeByParentId.html +++ b/target/classes/templates/pages/materialtype/materialTypeByParentId.html @@ -50,6 +50,11 @@ + + diff --git a/target/classes/templates/pages/materialtype/materialType_view.html b/target/classes/templates/pages/materialtype/materialType_view.html index f26e8328..6a657bd0 100644 --- a/target/classes/templates/pages/materialtype/materialType_view.html +++ b/target/classes/templates/pages/materialtype/materialType_view.html @@ -120,11 +120,11 @@ {type: "checkbox", width: 50}, {field: 'tname', width: 120, title: '类型名称'}, {field: 'introduce', width: 200, title: '类型介绍'}, - {field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'}, + {title: '状态', width: 100, templet: '#switchTpl', align: "center"}, {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"} ] ], - limits: [10, 15, 20, 25, 50,100], + limits: [10, 15, 20, 25, 50, 100], limit: 10, page: true, skin: 'line', @@ -140,7 +140,7 @@ if (data.tname !== '') { req.tname = data.tname; } - if (data.state != '') { + if (data.state !== '') { req.state = data.state; } req.parentId = parentId; @@ -271,7 +271,7 @@ table.on('tool(currentTableFilter)', function (obj) { let data = obj.data; - + console.log(data) if (obj.event === 'detail') { req = {}; req.parentId = parentId;