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; + } }