From f1be05e6e65abc9f57248598e97d642ebf20a04c Mon Sep 17 00:00:00 2001 From: erdanergou Date: Tue, 21 Mar 2023 16:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExcelServiceImpl.java | 25 +++++++++---------- .../pages/scanQrCode/ScanBarOrQrCodeOut.html | 9 ++----- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java index b5d377bd..a27ac0da 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java @@ -283,7 +283,7 @@ public class ExcelServiceImpl implements ExcelService { if (placeCode != null && !placeCode.isEmpty()) { Map placeMap = new HashMap<>(); placeMap.put("did", depositoryId); - placeMap.put("code", placeCode); + placeMap.put("kingdeecode", placeCode); // 根据仓库及库位码获取库位 List placeByCondition = placeService.findPlaceByCondition(placeMap); if (placeByCondition.size() > 0) { @@ -298,7 +298,6 @@ public class ExcelServiceImpl implements ExcelService { errMsg.add(msg); continue; } else { - excelInfoByInventory.setDepositoryCode(place.getCode()); excelVos.add(excelInfoByInventory); } } else { @@ -320,8 +319,7 @@ public class ExcelServiceImpl implements ExcelService { Future objectFuture = taskCenterUtil.submitTask(() -> { List success = new ArrayList<>(); Map returnResult = new HashMap<>(); - for (int i = 0; i < excelVos.size(); i++) { - ExcelInfoByInventory excelInfoByInventory = excelVos.get(i); + for (ExcelInfoByInventory excelInfoByInventory : excelVos) { Map insert = new HashMap<>(); insert.put("mname", excelInfoByInventory.getMname()); insert.put("version", excelInfoByInventory.getVersion()); @@ -350,7 +348,8 @@ public class ExcelServiceImpl implements ExcelService { materialService.insertInventoryForImport(insert); // 将该物料同时放入默认库位中 - String placeCode = excelInfoByInventories.get(i).getDepositoryCode(); + String placeCode = excelInfoByInventory.getDepositoryCode(); + Place placeById = null; Boolean isNew = (Boolean) insert.get("isNew"); if (isNew) { SplitInfo baseSplitInfoForMid = splitUnitService.findBaseSplitInfoForMid(material.getId()); @@ -361,10 +360,10 @@ public class ExcelServiceImpl implements ExcelService { } MaterialAndPlace placeAndMaterialByMidAndPid = null; // 如果是新插入物料 - if (placeCode == null || placeCode.isEmpty() || "0".equals(placeCode)) { // 如果没有输入库位 + if (placeCode == null || placeCode.isEmpty() || "0".equals(placeCode) || "0000".equals(placeCode) || "000000".equals(placeCode)) { // 如果没有输入库位 Map param = new HashMap<>(); // 获取默认库位 - Place placeById = placeService.findPlaceById(0); + placeById = placeService.findPlaceById(0); // 修改默认库位库存 placeById.setQuantity(placeById.getQuantity() + (int) (quantity * 100)); placeService.UpdatePlace(placeById); @@ -378,16 +377,16 @@ public class ExcelServiceImpl implements ExcelService { // 如果输入的库位不是默认库位 Map param = new HashMap<>(); param.put("did", depositoryId); - param.put("code", placeCode); + param.put("kingdeecode", placeCode); // 获取要导入的库位 - Place placeByCondition = placeService.findPlaceByCondition(param).get(0); + placeById = placeService.findPlaceByCondition(param).get(0); // 修改库位物料数量 - placeByCondition.setQuantity(placeByCondition.getQuantity() + (int) (quantity * 100)); - placeService.UpdatePlace(placeByCondition); + placeById.setQuantity(placeById.getQuantity() + (int) (quantity * 100)); + placeService.UpdatePlace(placeById); // 如果没有对应关系 - param.put("pid", placeByCondition.getId()); + param.put("pid", placeById.getId()); param.put("mid", insert.get("id")); param.put("quantity", (int) (quantity * 100)); // 添加对应关系 @@ -399,7 +398,7 @@ public class ExcelServiceImpl implements ExcelService { Map insertForSplitInfoStringObjectMap = new HashMap<>(); insertForSplitInfoStringObjectMap.put("depositoryId", depositoryId); insertForSplitInfoStringObjectMap.put("quantity", quantity_residue); - insertForSplitInfoStringObjectMap.put("placeId", "0"); + insertForSplitInfoStringObjectMap.put("placeId", placeById.getId().toString()); insertForSplitInfoStringObjectMap.put("mid", material.getId()); insertForSplitInfoStringObjectMap.put("unit", baseSplitInfoForMid.getNewUnit()); SplitInventory splitInventoryByIidAndSid = splitUnitService.findSplitInventoryByIidAndSid(placeAndMaterialByMidAndPid.getId(), baseSplitInfoForMid.getId()); diff --git a/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html b/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html index 0f9efed6..4016c94c 100644 --- a/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html +++ b/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html @@ -63,12 +63,7 @@ } else { wxScan = wxScan.parent.wx; } - - var result = "1635078996227301376";//当needResult为1时返回处理结果 - var req = {}; - req.qrCode = result; - outboundLogic(req); - /* wxScan.scanQRCode({ + wxScan.scanQRCode({ desc: 'scanQRCode desc', needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 @@ -87,7 +82,7 @@ } - });*/ + }); });