From 91a10eec82c5e508bd2507e16694691934f6377c 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, 25 Dec 2020 23:08:27 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD=E5=85=A5?=
=?UTF-8?q?=E5=BA=93=E5=88=97=E8=A1=A8=E5=BA=93=E5=AD=98=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
erp_web/pages/materials/material.html | 2 +-
.../erp/controller/DepotItemController.java | 25 ++++++-------------
.../entities/DepotItemVo4WithInfoEx.java | 10 ++++++++
.../mapper_xml/DepotItemMapperEx.xml | 3 ++-
4 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/erp_web/pages/materials/material.html b/erp_web/pages/materials/material.html
index 8acc923f..2ad1d3d4 100644
--- a/erp_web/pages/materials/material.html
+++ b/erp_web/pages/materials/material.html
@@ -645,7 +645,7 @@
}
function findStockList(mId, barCode, name) {
- var titleInfo = " " + name + "[" + barCode + "]库存及明细";
+ var titleInfo = " " + name + "[" + barCode + "]的库存及明细";
$('#materialDetailListDlg').dialog('open').dialog('setTitle', '
' + titleInfo);
$(".window-mask").css({width: webW, height: webH});
initDepotList(mId, "show"); //加载仓库及库存数量
diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java
index 95904335..02f8caf4 100644
--- a/src/main/java/com/jsh/erp/controller/DepotItemController.java
+++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java
@@ -127,7 +127,6 @@ public class DepotItemController {
@RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
- Map map = new HashMap();
Long tenantId = null;
if(request.getSession().getAttribute("tenantId")!=null) {
tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
@@ -147,29 +146,21 @@ public class DepotItemController {
JSONObject item = new JSONObject();
item.put("Id", diEx.getId());
item.put("MaterialExtendId", diEx.getMaterialExtendId() == null ? "" : diEx.getMaterialExtendId());
- String ratio; //比例
- if (diEx.getUnitId() == null || diEx.getUnitId().equals("")) {
- ratio = "";
- } else {
- ratio = diEx.getUnitName();
- ratio = ratio.substring(ratio.indexOf("("));
- }
- //名称/型号/扩展信息/包装
- String MaterialName = ((diEx.getMName() == null || diEx.getMName().equals("")) ? "" : diEx.getMName())
- + ((diEx.getMStandard() == null || diEx.getMStandard().equals("")) ? "" : "(" + diEx.getMStandard() + ")")
- + ((diEx.getMModel() == null || diEx.getMModel().equals("")) ? "" : "(" + diEx.getMModel() + ")");
- String materialOther = getOtherInfo(mpArr, diEx);
- MaterialName = MaterialName + materialOther + ((diEx.getUnitName() == null || diEx.getUnitName().equals("")) ? "" : "(" + diEx.getUnitName() + ")") + ratio;
- item.put("MaterialName", MaterialName == null ? "" : MaterialName);
item.put("barCode", diEx.getBarCode());
item.put("name", diEx.getMName());
item.put("standard", diEx.getMStandard());
item.put("model", diEx.getMModel());
- item.put("materialOther", materialOther);
+ item.put("materialOther", getOtherInfo(mpArr, diEx));
+ Integer ratio = diEx.getRatio();
BigDecimal stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null,tenantId);
+ if(ratio!=null){
+ BigDecimal ratioDecimal = new BigDecimal(ratio.toString());
+ if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){
+ stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数
+ }
+ }
item.put("Stock", stock);
item.put("Unit", diEx.getMaterialUnit());
- item.put("currentStock", diEx.getOperNumber().add(stock));
item.put("OperNumber", diEx.getOperNumber());
item.put("BasicNumber", diEx.getBasicNumber());
item.put("UnitPrice", diEx.getUnitPrice());
diff --git a/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java b/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java
index cb58c5a1..ff011967 100644
--- a/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java
+++ b/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4WithInfoEx.java
@@ -32,6 +32,8 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
private String unitName;
+ private Integer ratio;
+
private BigDecimal presetPriceOne;
private String priceStrategy;
@@ -152,6 +154,14 @@ public class DepotItemVo4WithInfoEx extends DepotItem{
this.unitName = unitName;
}
+ public Integer getRatio() {
+ return ratio;
+ }
+
+ public void setRatio(Integer ratio) {
+ this.ratio = ratio;
+ }
+
public BigDecimal getPresetPriceOne() {
return presetPriceOne;
}
diff --git a/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/src/main/resources/mapper_xml/DepotItemMapperEx.xml
index 2ace5b4d..9eab863d 100644
--- a/src/main/resources/mapper_xml/DepotItemMapperEx.xml
+++ b/src/main/resources/mapper_xml/DepotItemMapperEx.xml
@@ -29,6 +29,7 @@
+
@@ -140,7 +141,7 @@