From 74c2f40d44c89be3eac65d919c647e8f2cb31c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 24 Mar 2023 23:39:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=95=86=E5=93=81=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E9=87=8D?= =?UTF-8?q?=E9=87=8F=E5=AD=97=E6=AE=B5=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jsh/erp/controller/MaterialController.java | 1 + .../jsh/erp/datasource/entities/MaterialVo4Unit.java | 10 ++++++++++ .../java/com/jsh/erp/service/user/UserService.java | 11 +++++++---- .../main/resources/mapper_xml/MaterialMapperEx.xml | 7 +++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java index 5417021b..0e76a4ee 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java @@ -627,6 +627,7 @@ public class MaterialController { map.put("total", total); map.put("currentStock", materialVo4Unit.getCurrentStock()); map.put("currentStockPrice", materialVo4Unit.getCurrentStockPrice()); + map.put("currentWeight", materialVo4Unit.getCurrentWeight()); map.put("rows", dataList); res.code = 200; res.data = map; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java index a1c43037..7c9b6c10 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialVo4Unit.java @@ -34,6 +34,8 @@ public class MaterialVo4Unit extends Material{ private BigDecimal currentStockPrice; + private BigDecimal currentWeight; + private String sku; private Long depotId; @@ -163,6 +165,14 @@ public class MaterialVo4Unit extends Material{ this.currentStockPrice = currentStockPrice; } + public BigDecimal getCurrentWeight() { + return currentWeight; + } + + public void setCurrentWeight(BigDecimal currentWeight) { + this.currentWeight = currentWeight; + } + public String getSku() { return sku; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java index a53b437f..f1d2dc14 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java @@ -765,10 +765,13 @@ public class UserService { int selectUserSize = list.size(); //查询启用状态的用户的数量 int enableUserSize = getUser().size(); - long userNumLimit = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userNumLimit").toString()); - if(selectUserSize + enableUserSize > userNumLimit && status == 0) { - throw new BusinessParamCheckingException(ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_CODE, - ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_MSG); + User userInfo = userService.getCurrentUser(); + Tenant tenant = tenantService.getTenantByTenantId(userInfo.getTenantId()); + if(tenant!=null) { + if (selectUserSize + enableUserSize > tenant.getUserNumLimit() && status == 0) { + throw new BusinessParamCheckingException(ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_CODE, + ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_MSG); + } } StringBuilder userStr = new StringBuilder(); List idList = new ArrayList<>(); diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml index bd6d362c..41823f6d 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -22,6 +22,7 @@ + @@ -577,7 +578,8 @@ select m.*, me.commodity_unit unitName, mc.name categoryName, me.bar_code, ifnull(me.purchase_decimal,0) purchase_decimal, ifnull(sum(mcs.current_number),0) currentStock, - sum(ifnull(me.purchase_decimal, 0) * ifnull(mcs.current_number, 0)) currentStockPrice + sum(ifnull(me.purchase_decimal, 0) * ifnull(mcs.current_number, 0)) currentStockPrice, + sum(ifnull(m.weight, 0) * ifnull(mcs.current_number, 0)) currentWeight FROM jsh_material m left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1' @@ -653,7 +655,8 @@