Browse Source

欠货库存查询及商品补货分析导出调整

eganwu 2 years ago
parent
commit
58d9cad88d
1 changed files with 51 additions and 51 deletions
  1. 51 51
      src/custom/restcontroller/webmanage/sale/invbal/invbal.java

+ 51 - 51
src/custom/restcontroller/webmanage/sale/invbal/invbal.java

@@ -116,16 +116,16 @@ public class invbal extends Controller {
 
     @API(title = "查询Erp库存列表", apiversion = R.ID20230408091703.v1.class)
     public String queryErpInvbalList() throws YosException, IOException {
-        boolean isExport = content.getBooleanValue("isExport");
+//        boolean isExport = content.getBooleanValue("isExport");
         //String iteminfo = content.getStringValue("iteminfo");
         //String agentinfo = content.getStringValue("agentinfo");
         //boolean all = content.getBooleanValue("all");
         //JSONArray itemclassids = content.getJSONArray("itemclassids");
         String where = " 1=1 ";
         SQLFactory sqlFactory = new SQLFactory(this, "商品列表", pageSize, pageNumber, pageSorting);
-        if (isExport) {
-            sqlFactory = new SQLFactory(this, "商品列表");
-        }
+//        if (isExport) {
+//            sqlFactory = new SQLFactory(this, "商品列表");
+//        }
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("iteminfo")) {
@@ -157,9 +157,9 @@ public class invbal extends Controller {
             if (whereObject.containsKey("agentinfo")) {
                 if (!StringUtils.isBlank(whereObject.getStringValue("agentinfo"))) {
                     sqlFactory = new SQLFactory(this, "订单明细未发商品列表", pageSize, pageNumber, pageSorting);
-                    if (isExport) {
-                        sqlFactory = new SQLFactory(this, "订单明细未发商品列表");
-                    }
+//                    if (isExport) {
+//                        sqlFactory = new SQLFactory(this, "订单明细未发商品列表");
+//                    }
                     //System.out.println(StringUtils.isBlank(itemname) && StringUtils.isBlank(itemno) && itemclassids.size()==0);
                     if (!StringUtils.isBlank(whereObject.getStringValue("agentinfo"))) {
                         where = where + " and (t6.agentnum like '%" + whereObject.getStringValue("agentinfo") + "%' or t5.enterprisename like '%" + whereObject.getStringValue("agentinfo") + "%') ";
@@ -279,39 +279,39 @@ public class invbal extends Controller {
 //                System.out.println(row.toJsonObject().toJSONString());
 //            }
         }
-        if (isExport) {
-            //去除不需要导出项
-            rows.getFieldList().remove("itemid");
-            rows.getFieldList().remove("packageqty");
-            rows.getFieldList().remove("qty");
-//            for (Row row : rows) {
-//                if (row.getString("itemno").equals("10901371")) {
-//                    System.out.println(row.getString("canbesent"));
-//                    System.out.println(row.getString("canbesale"));
-//                    System.out.println(row.toJsonObject().toJSONString());
-//                }
-//
-//            }
-            Rows uploadRows = uploadExcelToObs("invbal", "库存列表", rows, getTitleMap());
-            return getSucReturnObject().setData(uploadRows).toString();
-        }
+//        if (isExport) {
+//            //去除不需要导出项
+//            rows.getFieldList().remove("itemid");
+//            rows.getFieldList().remove("packageqty");
+//            rows.getFieldList().remove("qty");
+////            for (Row row : rows) {
+////                if (row.getString("itemno").equals("10901371")) {
+////                    System.out.println(row.getString("canbesent"));
+////                    System.out.println(row.getString("canbesale"));
+////                    System.out.println(row.toJsonObject().toJSONString());
+////                }
+////
+////            }
+//            Rows uploadRows = uploadExcelToObs("invbal", "库存列表", rows, getTitleMap());
+//            return getSucReturnObject().setData(uploadRows).toString();
+//        }
         return getSucReturnObject().setData(rows).toString();
     }
 
     //返回导出的标题
-    public HashMap<String, String> getTitleMap() {
-        HashMap<String, String> titleMap = new HashMap<>();
-        titleMap.put("itemname", "产品名称");
-        titleMap.put("itemno", "产品编号");
-        titleMap.put("undelqty", "未发数量");
-        titleMap.put("invbalqty", "库存数");
-        titleMap.put("canbesent", "预计可发量");
-        titleMap.put("canbesale", "预计可售量");
-        titleMap.put("unitname", "单位");
-        titleMap.put("itemclass", "营销分类");
-        titleMap.put("isonsale", "是否上架");
-        return titleMap;
-    }
+//    public HashMap<String, String> getTitleMap() {
+//        HashMap<String, String> titleMap = new HashMap<>();
+//        titleMap.put("itemname", "产品名称");
+//        titleMap.put("itemno", "产品编号");
+//        titleMap.put("undelqty", "未发数量");
+//        titleMap.put("invbalqty", "库存数");
+//        titleMap.put("canbesent", "预计可发量");
+//        titleMap.put("canbesale", "预计可售量");
+//        titleMap.put("unitname", "单位");
+//        titleMap.put("itemclass", "营销分类");
+//        titleMap.put("isonsale", "是否上架");
+//        return titleMap;
+//    }
 
     @API(title = "查询指定商品对应的未发货订单明细", apiversion = R.ID20230408101803.v1.class)
     public String queryOrderDetailList() throws YosException {
@@ -336,7 +336,7 @@ public class invbal extends Controller {
 
     @API(title = "商品补货分析", apiversion = R.ID20231228102402.v1.class)
     public String queryItemSalesList() throws YosException, IOException {
-        boolean isExport = content.getBooleanValue("isExport");
+//        boolean isExport = content.getBooleanValue("isExport");
         int year = content.getIntValue("year");
         if (year <= 0) {
             Calendar calendar = Calendar.getInstance();
@@ -348,9 +348,9 @@ public class invbal extends Controller {
 
         String where = " 1=1 ";
         SQLFactory sqlFactory = new SQLFactory(this, "商品列表", pageSize, pageNumber, pageSorting);
-        if (isExport) {
-            sqlFactory = new SQLFactory(this, "商品列表");
-        }
+//        if (isExport) {
+//            sqlFactory = new SQLFactory(this, "商品列表");
+//        }
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("iteminfo")) {
@@ -381,9 +381,9 @@ public class invbal extends Controller {
             if (whereObject.containsKey("agentinfo")) {
                 if (!StringUtils.isBlank(whereObject.getStringValue("agentinfo"))) {
                     sqlFactory = new SQLFactory(this, "订单明细未发商品列表", pageSize, pageNumber, pageSorting);
-                    if (isExport) {
-                        sqlFactory = new SQLFactory(this, "订单明细未发商品列表");
-                    }
+//                    if (isExport) {
+//                        sqlFactory = new SQLFactory(this, "订单明细未发商品列表");
+//                    }
                     //System.out.println(StringUtils.isBlank(itemname) && StringUtils.isBlank(itemno) && itemclassids.size()==0);
                     if (!StringUtils.isBlank(whereObject.getStringValue("agentinfo"))) {
                         where = where + " and (t6.agentnum like '%" + whereObject.getStringValue("agentinfo") + "%' or t5.enterprisename like '%" + whereObject.getStringValue("agentinfo") + "%') ";
@@ -542,14 +542,14 @@ public class invbal extends Controller {
                 row.replace(key, row.getBigDecimal(key).subtract(closeRow.getBigDecimal("qty")));
             }
         }
-        if (isExport) {
-            //去除不需要导出项
-            rows.getFieldList().remove("itemid");
-            rows.getFieldList().remove("packageqty");
-            rows.getFieldList().remove("qty");
-            Rows uploadRows = uploadExcelToObs("invbal", "商品补货分析", rows, getTitleMap());
-            return getSucReturnObject().setData(uploadRows).toString();
-        }
+//        if (isExport) {
+//            //去除不需要导出项
+//            rows.getFieldList().remove("itemid");
+//            rows.getFieldList().remove("packageqty");
+//            rows.getFieldList().remove("qty");
+//            Rows uploadRows = uploadExcelToObs("invbal", "商品补货分析", rows, getTitleMap());
+//            return getSucReturnObject().setData(uploadRows).toString();
+//        }
         return getSucReturnObject().setData(rows).toString();
     }