Browse Source

库存汇总表统计商品数量方式修改

master
lzh 2 years ago
parent
commit
107b5647f4
  1. 15
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java
  2. 36
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java
  3. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20221221.xlsx
  4. BIN
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx

15
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkMapper.java

@ -64,7 +64,8 @@ public interface GdInventoryOkMapper extends BaseMapper<GdInventoryOk> {
@Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='1' and warehouseCode<>'112'") @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='1' and warehouseCode<>'112'")
int countProd1Not112(); int countProd1Not112();
@Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='2'") // @Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseType='2'")
@Select("select IFNULL(count(1),0) FROM (SELECT DISTINCT prodCode from gd_inventory_ok where warehouseType='2') t")
int countProd2(); int countProd2();
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='112'") @Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='112'")
@ -82,4 +83,16 @@ public interface GdInventoryOkMapper extends BaseMapper<GdInventoryOk> {
@Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_ok order by warehouseType") @Select("select warehouseCode, warehouseName, warehouseType, prodCode, prodBarCode, prodName, prodNum, prodValue from gd_inventory_ok order by warehouseType")
List<Map<String, Object>> listOfProd(); List<Map<String, Object>> listOfProd();
@Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseCode='101'")
int countProd101();
@Select("select IFNULL(count(1),0) from gd_inventory_ok where warehouseCode='199'")
int countProd199();
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='101'")
double countVal101();
@Select("select IFNULL(sum(prodValue),0) from gd_inventory_ok where warehouseCode='199'")
double countVal199();
} }

36
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java

@ -27,7 +27,6 @@ package com.yxt.supervise.portal.biz.gdinventory;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter; import cn.hutool.poi.excel.ExcelWriter;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -36,7 +35,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.File; import java.io.File;
import java.net.URL;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -75,13 +73,17 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
public ResultBean kchz() { public ResultBean kchz() {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
int type1 = baseMapper.countWarehouseType1Not112(); // int type1 = baseMapper.countWarehouseType1Not112();
int type2 = baseMapper.countWarehouseType2(); int type2 = baseMapper.countWarehouseType2();
int prod112 = baseMapper.countProd112(); int prod112 = baseMapper.countProd112();
int prod1Not112 = baseMapper.countProd1Not112(); int prod101 = baseMapper.countProd101();
int prod199 = baseMapper.countProd199();
// int prod1Not112 = baseMapper.countProd1Not112();
int prod2 = baseMapper.countProd2(); int prod2 = baseMapper.countProd2();
double val112 = baseMapper.countVal112(); double val112 = baseMapper.countVal112();
double val1Not112 = baseMapper.countVal1Not112(); double val101 = baseMapper.countVal101();
double val199 = baseMapper.countVal199();
// double val1Not112 = baseMapper.countVal1Not112();
double val2 = baseMapper.countVal2(); double val2 = baseMapper.countVal2();
Date curDate = new Date(); Date curDate = new Date();
@ -108,14 +110,26 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
}else { }else {
writer.writeCellValue(1, 3, 0); writer.writeCellValue(1, 3, 0);
} }
writer.writeCellValue(1, 4, type1); if(prod101>0){
writer.writeCellValue(1, 5, type2); writer.writeCellValue(1, 4, 1);
}else {
writer.writeCellValue(1, 4, 0);
}
if(prod199>0){
writer.writeCellValue(1, 5, 1);
}else {
writer.writeCellValue(1, 5, 0);
}
// writer.writeCellValue(1, 4, type1);
writer.writeCellValue(1, 6, type2);
writer.writeCellValue(2, 3, prod112); writer.writeCellValue(2, 3, prod112);
writer.writeCellValue(2, 4, prod1Not112); writer.writeCellValue(2, 4, prod101);
writer.writeCellValue(2, 5, prod2); writer.writeCellValue(2, 5, prod199);
writer.writeCellValue(2, 6, prod2);
writer.writeCellValue(3, 3, val112); writer.writeCellValue(3, 3, val112);
writer.writeCellValue(3, 4, val1Not112); writer.writeCellValue(3, 4, val101);
writer.writeCellValue(3, 5, val2); writer.writeCellValue(3, 5, val199);
writer.writeCellValue(3, 6, val2);
// writer.flush(); // writer.flush();
// writer.close(); // writer.close();

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表-20221221.xlsx

Binary file not shown.

BIN
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/resources/xlsx-tmpl/库存汇总表.xlsx

Binary file not shown.
Loading…
Cancel
Save