From 67709130793154aa46d3a0d573ec904034e28ec0 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 25 May 2023 13:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=87=BA=E5=85=A5=E5=BA=93=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=B3=E8=AF=B7=E4=BA=BA=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PageController.java | 6 +- .../impl/DepositoryRecordServiceImpl.java | 6 +- .../service/impl/StockTakingServiceImpl.java | 141 ++++++++---------- 3 files changed, 73 insertions(+), 80 deletions(-) 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 597fa7f4..0f45d033 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -2045,7 +2045,7 @@ public class PageController { recordP.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(recordP.getApplicantTime()))); recordP.setDepartmentheadTime(DateUtil.TimeStampToDateTime(Long.valueOf(recordP.getDepartmentheadTime()))); recordP.setDepositoryManagerName(depositoryManagerNames.toString()); - recordP.setApplicantName(userByPort.getName()); + recordP.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); recordP.setDepartmentheadName(departmentHeadName.toString()); recordP.setDepositoryName(depositoryName.toString()); recordP.setQuantity(sumQuantity); @@ -2193,7 +2193,7 @@ public class PageController { if (Integer.compare(flagForGroup, 2) != 0) { // 如果不是组合 UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationInRecordPById.getApplicantId(), userKey, token); - applicationInRecordPById.setApplicantName(userByPort.getName()); + applicationInRecordPById.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); if (applicationInRecordPById.getPrice() != null) { applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); @@ -3654,7 +3654,7 @@ public class PageController { ApplicationOutRecordMinP applicationOutMinById = depositoryRecordService.findApplicationOutMinById(minRecordId); ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(applicationOutMinById.getParentId()); UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userKey, token); - applicationOutRecordPById.setApplicantName(userByPort.getName()); + applicationOutRecordPById.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); SimpleTaskP simpleTaskP = new SimpleTaskP(applicationOutRecordPById, applicationOutMinById); list.add(simpleTaskP); } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index f45198b7..64e12e7f 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -473,6 +473,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { /** * 计算出库物料总数 + * * @param state * @return */ @@ -5082,7 +5083,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { SimpleApplicationOutOrInRecordP d = new SimpleApplicationOutOrInRecordP(record); UserByPort userByPort = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userKey, token); d.setApplyRemark(d.getApplyRemark() == null ? "" : d.getApplyRemark()); - d.setApplicantName(userByPort.getName()); + d.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); + result.add(d); } return result; @@ -5094,7 +5096,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { SimpleApplicationOutOrInRecordP d = new SimpleApplicationOutOrInRecordP(record); UserByPort userByPort = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userKey, token); d.setApplyRemark(d.getApplyRemark() == null ? "" : d.getApplyRemark()); - d.setApplicantName(userByPort.getName()); + d.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); result.add(d); } return result; diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java index bc5f2899..a85d4e08 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java @@ -43,27 +43,20 @@ public class StockTakingServiceImpl implements StockTakingService { @Autowired RedissonClient redissonClient; - - @Autowired - private RedisPool redisPool; - @Autowired MaterialMapper materialMapper; - @Autowired DepositoryRecordService depositoryRecordService; - @Autowired DepositoryRecordMapper depositoryRecordMapper; - @Autowired QyWxOperationService qyWxOperationService; - @Autowired SplitUnitMapper splitUnitMapper; - @Autowired SplitUnitService splitUnitService; + @Autowired + private RedisPool redisPool; /** * 用于插入盘点记录主表 @@ -247,7 +240,7 @@ public class StockTakingServiceImpl implements StockTakingService { * @return 我的任务 */ @Override - public List findMyTask(Map map, String userKey,String token) { + public List findMyTask(Map map, String userKey, String token) { Integer size = 10, page = 1; if (map.containsKey("size")) { size = ObjectFormatUtil.toInteger(map.get("size")); @@ -264,8 +257,8 @@ public class StockTakingServiceImpl implements StockTakingService { SimpleStockTakingP ssp = new SimpleStockTakingP(stockTaking); Depository depositoryRecordById = depositoryMapper.findDepositoryById(stockTaking.getDepositoryId()); ssp.setDepositoryName(depositoryRecordById.getDname()); - UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userKey,token); - ssp.setOriginatorName(userByPort.getName()); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userKey, token); + ssp.setOriginatorName(userByPort.getMaindeparmentname() + "_" + userByPort.getName()); stockTakingPS.add(ssp); } return stockTakingPS; @@ -290,7 +283,7 @@ public class StockTakingServiceImpl implements StockTakingService { * @return 我的任务 */ @Override - public List findMyApply(Map map, String userKey,String token) { + public List findMyApply(Map map, String userKey, String token) { Integer size = 10, page = 1; if (map.containsKey("size")) { size = ObjectFormatUtil.toInteger(map.get("size")); @@ -306,7 +299,7 @@ public class StockTakingServiceImpl implements StockTakingService { SimpleStockTakingP ssp = new SimpleStockTakingP(stockTaking); Depository depositoryRecordById = depositoryMapper.findDepositoryById(stockTaking.getDepositoryId()); ssp.setDepositoryName(depositoryRecordById.getDname()); - UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userKey,token); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(stockTaking.getOriginator(), userKey, token); ssp.setOriginatorName(userByPort.getName()); stockTakingPS.add(ssp); } @@ -408,7 +401,7 @@ public class StockTakingServiceImpl implements StockTakingService { */ @Transactional(rollbackFor = Exception.class) @Override - public Map review(Map map, UserByPort userToken, String userAgent,String userKey,String token) { + public Map review(Map map, UserByPort userToken, String userAgent, String userKey, String token) { Map result = new HashMap<>(); @@ -575,7 +568,7 @@ public class StockTakingServiceImpl implements StockTakingService { // if(workwechat == null || "".equals(workwechat)){ // workwechat = originator.getWechat(); // } - JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinId, userAgent,userKey,token); + JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinId, userAgent, userKey, token); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId, normalMinId, userAgent,userKey,token); // 将当前返回结果保存到redis中 if (jsonObject != null) { @@ -621,7 +614,7 @@ public class StockTakingServiceImpl implements StockTakingService { } String s = QyWxUid1.toString(); s = "PangFuZhen,"; - qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(mainId), s, userAgent, 2,userKey,token); + qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(mainId), s, userAgent, 2, userKey, token); }); return result; @@ -637,7 +630,7 @@ public class StockTakingServiceImpl implements StockTakingService { */ @Transactional(rollbackFor = Exception.class) @Override - public Map completeStockTaking(Map map, UserByPort userToken, String userAgent,String userKey,String token) { + public Map completeStockTaking(Map map, UserByPort userToken, String userAgent, String userKey, String token) { Map result = new HashMap<>(); @@ -742,24 +735,24 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果当前盘点数量大于库存数量 // 修改当前库存 - materialAndProducedDate.setInventory((int)(newInventory * 100)); + materialAndProducedDate.setInventory((int) (newInventory * 100)); // 修改使用数量 - materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); + materialAndProducedDate.setExpendnum((int) (materialAndProducedDate.getQuantity() - newInventory * 100)); // 修改物料对应数量 - inventoryById.setQuantity((int)(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); + inventoryById.setQuantity((int) (inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); } else { // 如果当前盘点数量小于库存数量 // 修改当前库存 - materialAndProducedDate.setInventory((int)(newInventory * 100)); + materialAndProducedDate.setInventory((int) (newInventory * 100)); // 修改使用数量 - materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); + materialAndProducedDate.setExpendnum((int) (materialAndProducedDate.getQuantity() - newInventory * 100)); // 修改物料对应数量 - inventoryById.setQuantity((int)(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); + inventoryById.setQuantity((int) (inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); } materialMapper.updateMaterialAndProducedDate(materialAndProducedDate); @@ -777,7 +770,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { // 更新当前库位数量 - newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); + newNumberForPlace = placeById.getQuantity() + (int) (inventory * 100); if (newNumberForPlace <= placeById.getMax()) { // 如果更新后的库位数量没有上溢 @@ -791,9 +784,9 @@ public class StockTakingServiceImpl implements StockTakingService { continue; } - inventoryById.setQuantity(inventoryById.getQuantity() +(int)( inventory * 100)); + inventoryById.setQuantity(inventoryById.getQuantity() + (int) (inventory * 100)); - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() +(int)( inventory * 100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int) (inventory * 100); // 更新物料与库位对应关系的数量 placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); @@ -875,7 +868,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { // 如果盘点的是基础单位 - newNumberForPlace = placeById.getQuantity() - (int)(inventory * 100); + newNumberForPlace = placeById.getQuantity() - (int) (inventory * 100); if (newNumberForPlace > placeById.getMin()) { //如果更新后的库位数量没有下溢 @@ -884,14 +877,14 @@ public class StockTakingServiceImpl implements StockTakingService { placeById.setQuantity(newNumberForPlace); // 更新物料与库位对应关系的数量 - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory * 100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int) (inventory * 100); } else { placeById.setQuantity(0); newNumberForMatrialAndPlace = 0; } - inventoryById.setQuantity(inventoryById.getQuantity() - (int)(inventory * 100)); + inventoryById.setQuantity(inventoryById.getQuantity() - (int) (inventory * 100)); placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); @@ -913,7 +906,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果单纯的拆单库存满足数量 // 设置当前拆单库存的数量 - splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int)(inventory * 100)); + splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int) (inventory * 100)); // 修改拆单库存 splitUnitMapper.updateSplitInventory(splitInventory); } else { @@ -970,8 +963,8 @@ public class StockTakingServiceImpl implements StockTakingService { // 设置剩余拆单库存处理数量 - splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int)(inventory * 100)); - splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int)(inventory * 100)); + splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int) (inventory * 100)); + splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int) (inventory * 100)); splitUnitMapper.updateSplitInventory(splitInventory); } } else { @@ -1055,7 +1048,7 @@ public class StockTakingServiceImpl implements StockTakingService { int residue = (int) (Math.ceil(inventory / (double) scale)); // 获取剩余数目 - int residue_realQuantity = residue * scale - (int)(inventory); + int residue_realQuantity = residue * scale - (int) (inventory); // 更新库存数量 @@ -1124,14 +1117,14 @@ public class StockTakingServiceImpl implements StockTakingService { SendQyWxMessageThreadPool.execute(() -> { String s = QyWxUid.toString(); s = "PangFuZhen,"; - JSONObject jsonObject = qyWxOperationService.sendCcStockTakingMessageToHead(s, map, userToken, mainRecord, userAgent,userKey,token); + JSONObject jsonObject = qyWxOperationService.sendCcStockTakingMessageToHead(s, map, userToken, mainRecord, userAgent, userKey, token); }); // 更新其他卡片 SendQyWxMessageThreadPool.execute(() -> { // 获取responseCode(key为申请人number) Integer originator = mainRecord.getOriginator(); - UserByPort userByPort = LinkInterfaceUtil.FindUserById(originator,userKey,token); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(originator, userKey, token); //获取申请人信息 String key = "user:" + userByPort.getNumber() + ":QyWxStockTakingCompleteId:" + mainId; String responseCode = (String) redisPool.getRedisTemplateByDb(14).opsForHash().get(key, "responseCode"); @@ -1253,24 +1246,24 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果当前盘点数量大于库存数量 // 修改当前库存 - materialAndProducedDate.setInventory((int)(newInventory * 100)); + materialAndProducedDate.setInventory((int) (newInventory * 100)); // 修改使用数量 - materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); + materialAndProducedDate.setExpendnum((int) (materialAndProducedDate.getQuantity() - newInventory * 100)); // 修改物料对应数量 - inventoryById.setQuantity((int)(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); + inventoryById.setQuantity((int) (inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); } else { // 如果当前盘点数量小于库存数量 // 修改当前库存 - materialAndProducedDate.setInventory((int)(newInventory * 100)); + materialAndProducedDate.setInventory((int) (newInventory * 100)); // 修改使用数量 - materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); + materialAndProducedDate.setExpendnum((int) (materialAndProducedDate.getQuantity() - newInventory * 100)); // 修改物料对应数量 - inventoryById.setQuantity((int)(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); + inventoryById.setQuantity((int) (inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); } materialMapper.updateMaterialAndProducedDate(materialAndProducedDate); @@ -1288,7 +1281,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { // 更新当前库位数量 - newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); + newNumberForPlace = placeById.getQuantity() + (int) (inventory * 100); if (newNumberForPlace <= placeById.getMax()) { // 如果更新后的库位数量没有上溢 @@ -1302,9 +1295,9 @@ public class StockTakingServiceImpl implements StockTakingService { continue; } - inventoryById.setQuantity(inventoryById.getQuantity() +(int)( inventory * 100)); + inventoryById.setQuantity(inventoryById.getQuantity() + (int) (inventory * 100)); - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() +(int)( inventory * 100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int) (inventory * 100); // 更新物料与库位对应关系的数量 placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); @@ -1386,7 +1379,7 @@ public class StockTakingServiceImpl implements StockTakingService { if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { // 如果盘点的是基础单位 - newNumberForPlace = placeById.getQuantity() - (int)(inventory * 100); + newNumberForPlace = placeById.getQuantity() - (int) (inventory * 100); if (newNumberForPlace > placeById.getMin()) { //如果更新后的库位数量没有下溢 @@ -1395,14 +1388,14 @@ public class StockTakingServiceImpl implements StockTakingService { placeById.setQuantity(newNumberForPlace); // 更新物料与库位对应关系的数量 - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory * 100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int) (inventory * 100); } else { placeById.setQuantity(0); newNumberForMatrialAndPlace = 0; } - inventoryById.setQuantity(inventoryById.getQuantity() - (int)(inventory * 100)); + inventoryById.setQuantity(inventoryById.getQuantity() - (int) (inventory * 100)); placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); @@ -1424,7 +1417,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果单纯的拆单库存满足数量 // 设置当前拆单库存的数量 - splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int)(inventory * 100)); + splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int) (inventory * 100)); // 修改拆单库存 splitUnitMapper.updateSplitInventory(splitInventory); } else { @@ -1481,8 +1474,8 @@ public class StockTakingServiceImpl implements StockTakingService { // 设置剩余拆单库存处理数量 - splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int)(inventory * 100)); - splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int)(inventory * 100)); + splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int) (inventory * 100)); + splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int) (inventory * 100)); splitUnitMapper.updateSplitInventory(splitInventory); } } else { @@ -1566,7 +1559,7 @@ public class StockTakingServiceImpl implements StockTakingService { int residue = (int) (Math.ceil(inventory / (double) scale)); // 获取剩余数目 - int residue_realQuantity = residue * scale - (int)(inventory); + int residue_realQuantity = residue * scale - (int) (inventory); // 更新库存数量 @@ -1661,7 +1654,7 @@ public class StockTakingServiceImpl implements StockTakingService { } String s = QyWxUid.toString(); s = "PangFuZhen,"; - JSONObject jsonObject = qyWxOperationService.sendCcStockTakingMessageToHead(s, map, null, finalMainRecord, userAgent,userKey,token); + JSONObject jsonObject = qyWxOperationService.sendCcStockTakingMessageToHead(s, map, null, finalMainRecord, userAgent, userKey, token); }); return 1; @@ -1783,7 +1776,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 获取当前库位上物料数量 int oldQuantity = inventoryById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); - inventoryById.setQuantity(oldQuantity + (int)(newInventory * 100)); + inventoryById.setQuantity(oldQuantity + (int) (newInventory * 100)); // 用于计算新的库位数量 @@ -1794,7 +1787,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果盘盈 // 更新当前库位数量 - newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); + newNumberForPlace = placeById.getQuantity() + (int) (inventory * 100); if (newNumberForPlace < placeById.getMax()) { @@ -1810,14 +1803,14 @@ public class StockTakingServiceImpl implements StockTakingService { continue; } - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int)(inventory*100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int) (inventory * 100); // 更新物料与库位对应关系的数量 placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); } else { // 如果盘亏 - newNumberForPlace = placeById.getQuantity() - (int)(inventory*100); + newNumberForPlace = placeById.getQuantity() - (int) (inventory * 100); if (newNumberForPlace > placeById.getMin()) { //如果更新后的库位数量没有下溢 @@ -1826,7 +1819,7 @@ public class StockTakingServiceImpl implements StockTakingService { placeById.setQuantity(newNumberForPlace); // 更新物料与库位对应关系的数量 - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory*100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int) (inventory * 100); } else { placeById.setQuantity(0); @@ -1860,7 +1853,7 @@ public class StockTakingServiceImpl implements StockTakingService { // if(workwechat == null || "".equals(workwechat)){ // workwechat = originator.getWechat(); // } - JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", ObjectFormatUtil.toInteger(mainId), normalMinId, userAgent,userKey,token); + JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", ObjectFormatUtil.toInteger(mainId), normalMinId, userAgent, userKey, token); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, ObjectFormatUtil.toInteger(mainId), normalMinId,userAgent,userKey,token); // 将当前返回结果保存到redis中 if (jsonObject != null) { @@ -1878,8 +1871,7 @@ public class StockTakingServiceImpl implements StockTakingService { map.put("state", 1); } - } - else { + } else { map.put("departmentManagerState", 2); map.put("completeTime", DateUtil.DateTimeToTimeStamp(simpleTime)); map.put("state", 2); @@ -1890,8 +1882,7 @@ public class StockTakingServiceImpl implements StockTakingService { map.put("departmentManager", approver_user.getNumber()); stockTakingMapper.updateStockTaking(map); return result; - } - else { + } else { // 如果当前盘点记录已经审核过 // 不做任何处理 @@ -1909,7 +1900,7 @@ public class StockTakingServiceImpl implements StockTakingService { */ @Transactional(rollbackFor = Exception.class) @Override - public Integer stockTakingTransfer(Map map, UserByPort userToken, String userAgent,String userKey,String token) { + public Integer stockTakingTransfer(Map map, UserByPort userToken, String userAgent, String userKey, String token) { // 获取当前转移的id List minIds = (List) map.get("minIds"); @@ -2728,14 +2719,14 @@ public class StockTakingServiceImpl implements StockTakingService { Integer originator = finalMainRecord.getOriginator(); map.put("minIds", minIds); StringBuilder departMentHeadQyWxName = new StringBuilder(); - UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(originator),userKey,token); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(originator), userKey, token); String workwechat = userByPort.getWorkwechat(); if (workwechat == null || "".equals(workwechat)) { workwechat = userByPort.getWechat(); } // departMentHeadQyWxName.append(workwechat+","); departMentHeadQyWxName.append("PangFuZhen,"); - JSONObject jsonObject = qyWxOperationService.sendCcStockTakingTransferMessageToHead(departMentHeadQyWxName.toString(), map, userToken, finalMainRecord, userAgent,userKey,token); + JSONObject jsonObject = qyWxOperationService.sendCcStockTakingTransferMessageToHead(departMentHeadQyWxName.toString(), map, userToken, finalMainRecord, userAgent, userKey, token); }); @@ -2844,7 +2835,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 获取当前库位上物料数量 int oldQuantity = materialById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); - materialById.setQuantity(oldQuantity + (int)(newInventory*100)); + materialById.setQuantity(oldQuantity + (int) (newInventory * 100)); // 用于计算新的库位数量 @@ -2855,7 +2846,7 @@ public class StockTakingServiceImpl implements StockTakingService { // 如果盘盈 // 更新当前库位数量 - newNumberForPlace = placeById.getQuantity() +(int)(inventory*100); + newNumberForPlace = placeById.getQuantity() + (int) (inventory * 100); if (newNumberForPlace < placeById.getMax()) { @@ -2871,14 +2862,14 @@ public class StockTakingServiceImpl implements StockTakingService { continue; } - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int)(inventory*100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int) (inventory * 100); // 更新物料与库位对应关系的数量 placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); } else { // 如果盘亏 - newNumberForPlace = placeById.getQuantity() - (int)(inventory*100); + newNumberForPlace = placeById.getQuantity() - (int) (inventory * 100); if (newNumberForPlace > placeById.getMin()) { //如果更新后的库位数量没有下溢 @@ -2887,7 +2878,7 @@ public class StockTakingServiceImpl implements StockTakingService { placeById.setQuantity(newNumberForPlace); // 更新物料与库位对应关系的数量 - newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() -(int)( inventory*100); + newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int) (inventory * 100); } else { placeById.setQuantity(0); @@ -2916,12 +2907,12 @@ public class StockTakingServiceImpl implements StockTakingService { // 抄送盘点调账记录给盘点人员 SendQyWxMessageThreadPool.execute((Runnable) () -> { // 获取盘点人员 - UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userkey,token); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userkey, token); // String workwechat = originator.getWorkwechat(); // if(workwechat == null || "".equals(workwechat)){ // workwechat = originator.getWechat(); // } - JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinIds, userAgent,userkey,token); + JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage("PangFuZhen,", mainId, normalMinIds, userAgent, userkey, token); // JSONObject jsonObject = qyWxOperationService.sendQyWxToStockTakingMessage(workwechat, mainId, normalMinIds, userAgent,userkey,token); if (jsonObject != null) { // 将当前返回结果保存到redis中 @@ -2940,12 +2931,12 @@ public class StockTakingServiceImpl implements StockTakingService { // 发送错误消息提醒负责人 SendQyWxMessageThreadPool.execute(() -> { // 获取盘点人员 - UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userkey,token); + UserByPort originator = LinkInterfaceUtil.FindUserById(mainRecord.getOriginator(), userkey, token); // String workwechat = originator.getWorkwechat(); // if(workwechat == null || "".equals(workwechat)){ // workwechat = originator.getWechat(); // } - qyWxOperationService.sendStockTakingErrMessageToHead("PangFuZhen,", errIds, mainRecord, null, userAgent,userkey,token); + qyWxOperationService.sendStockTakingErrMessageToHead("PangFuZhen,", errIds, mainRecord, null, userAgent, userkey, token); // qyWxOperationService.sendStockTakingErrMessageToHead(workwechat, errIds, mainRecord, null, userAgent,userkey,token); }); }