From 71f4a380098bc47229824a65cb10183bfddf2aa1 Mon Sep 17 00:00:00 2001 From: lzh Date: Sat, 7 Jan 2023 15:24:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E5=95=86=E5=93=81=E6=95=B0=E9=87=8F=E7=9A=84Map?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/gdinventory/GdInventoryOkMapper.java | 3 +++ .../biz/gdinventory/GdInventoryOkService.java | 26 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java index 408ef6d7..8205df31 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java @@ -95,4 +95,7 @@ public interface GdInventoryOkMapper extends BaseMapper { @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='199'") double countVal199(); + + @Select("select prodCode,IFNULL(sum(prodNum),0) pnum from gd_inventory_ok group by prodCode") + List> numberOfProduct(); } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java index 63f19c7c..e76da84f 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java @@ -29,6 +29,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelWriter; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yxt.common.core.result.ResultBean; import org.springframework.beans.factory.annotation.Value; @@ -36,6 +37,7 @@ import org.springframework.stereotype.Service; import java.io.File; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -105,19 +107,19 @@ public class GdInventoryOkService extends ServiceImpl0){ + if (prod112 > 0) { writer.writeCellValue(1, 3, 1); - }else { + } else { writer.writeCellValue(1, 3, 0); } - if(prod101>0){ + if (prod101 > 0) { writer.writeCellValue(1, 4, 1); - }else { + } else { writer.writeCellValue(1, 4, 0); } - if(prod199>0){ + if (prod199 > 0) { writer.writeCellValue(1, 5, 1); - }else { + } else { writer.writeCellValue(1, 5, 0); } // writer.writeCellValue(1, 4, type1); @@ -175,4 +177,16 @@ public class GdInventoryOkService extends ServiceImpl numberMapOfProduct() { + Map map = new HashMap<>(); + List> list = baseMapper.numberOfProduct(); + list.forEach(m -> map.put(m.get("prodCode"), m.get("pnum"))); + return map; + } }