From b2a7e834323f6bba5c6cff25988a055ee3d01b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E8=AF=9D?= <752718920@qq.com> Date: Thu, 5 May 2022 23:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=9B=E9=94=80=E5=AD=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/erp/controller/DepotItemController.java | 15 ++------------- .../resources/mapper_xml/DepotItemMapperEx.xml | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java index 8b2f88c7..b2064f24 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -299,11 +299,6 @@ public class DepotItemController { //存放数据json数组 JSONArray dataArray = new JSONArray(); if (null != dataList) { - List idList = new ArrayList<>(); - for (DepotItemVo4WithInfoEx m : dataList) { - idList.add(m.getMId()); - } - List meList = materialExtendService.getListByMIds(idList); for (DepotItemVo4WithInfoEx diEx : dataList) { JSONObject item = new JSONObject(); Long mId = diEx.getMId(); @@ -325,14 +320,8 @@ public class DepotItemController { item.put("inSum", inSum); item.put("outSum", outSum); item.put("thisSum", thisSum); - for(MaterialExtend me:meList) { - if(me.getMaterialId().longValue() == diEx.getMId().longValue()) { - if(me.getPurchaseDecimal()!=null) { - item.put("unitPrice", me.getPurchaseDecimal()); - item.put("thisAllPrice", thisSum.multiply(me.getPurchaseDecimal())); - } - } - } + item.put("unitPrice", diEx.getPurchaseDecimal()); + item.put("thisAllPrice", thisSum.multiply(diEx.getPurchaseDecimal())); dataArray.add(item); } } diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml index dbd3acc8..4ff0c60a 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -191,7 +191,7 @@ select m.id MId, me.bar_code, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard, m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3, concat_ws('', m.unit, u.basic_unit) MaterialUnit, m.color MColor, u.name unit_name, - (select purchase_decimal from jsh_material_extend me + (select ifnull(purchase_decimal,0) from jsh_material_extend me where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1) purchase_decimal from jsh_material m