Explorar el Código

u8产品入库成本导入明细列表错误修复

shenjingwei hace 2 semanas
padre
commit
c5344ce429

+ 11 - 9
src/custom/restcontroller/webmanage/sale/u8prodprice/u8prodpricedatail.java

@@ -25,7 +25,7 @@ public class u8prodpricedatail extends Controller {
     @API(title = "u8产品入库成本导入明细列表", apiversion = R.ID2025082214071703.v1.class)
     @CACHEING
     public String queryList_u8prodpricedatail() throws YosException {
-        Long sa_sendplanid = content.getLongValue("sa_u8prodpriceid");
+        Long sa_u8prodpriceid = content.getLongValue("sa_u8prodpriceid");
         /*
           过滤条件设置
          */
@@ -40,16 +40,17 @@ public class u8prodpricedatail extends Controller {
                 where.append(")");
             }
         }
-        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_u8prodprice_datail","*");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_u8prodprice_datail", "*");
         querySQL.setTableAlias("t1");
-        querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.siteid = t2.siteid and t1.itemno = t2.itemno","itemname","model","itemid");
+        querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.siteid = t2.siteid and t1.itemno = t2.itemno", "itemname", "model", "itemid");
         querySQL.setSiteid(siteid);
         querySQL.setWhere(where.toString());
+        querySQL.setWhere("sa_u8prodpriceid", sa_u8prodpriceid);
         querySQL.setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();
         return getSucReturnObject().setData(rows).toString();
     }
-    
+
 
     @API(title = "下载u8产品入库成本导入明细模板", apiversion = R.ID2025082214133803.v1.class)
     public String downloadU8prodpricedatailExcel() throws YosException {
@@ -66,12 +67,12 @@ public class u8prodpricedatail extends Controller {
         }
         // 设置工作薄列宽
         ExportExcel.setBatchDetailSheetColumn1(sheet);// 设置工作薄列宽
-        XSSFCellStyle titleCellStyle1 =ExportExcel.createTitleCellStyle1(xssfFWorkbook);
+        XSSFCellStyle titleCellStyle1 = ExportExcel.createTitleCellStyle1(xssfFWorkbook);
         XSSFCellStyle titleCellStyle2 = ExportExcel.createTitleCellStyle2(xssfFWorkbook);
         XSSFCellStyle titleCellStyle3 = ExportExcel.createTitleCellStyle3(xssfFWorkbook);
         XSSFCellStyle titleCellStyle4 = ExportExcel.createBodyCellStyle4(xssfFWorkbook);
 
-       ExportExcel.batchDetail(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, titleCellStyle4, xssfFWorkbook);
+        ExportExcel.batchDetail(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, titleCellStyle4, xssfFWorkbook);
 
         Rows aa = saveToExcelAttachment(excelFactory);
         String url = "";
@@ -82,7 +83,6 @@ public class u8prodpricedatail extends Controller {
 
     }
 
-   
 
     /**
      * 导入u8产品入库成本导入明细
@@ -135,13 +135,13 @@ public class u8prodpricedatail extends Controller {
                     rowserr.add(row);
                     continue;
                 }
-                if(!isNumeric(costprice)){
+                if (!isNumeric(costprice)) {
                     iserr = true;
                     row.put("msg", "成本单价不为数字格式,请检查");
                     rowserr.add(row);
                     continue;
                 }
-                if (imtitemRowsMap.get(itemno).toRowsMap("stockno").size() !=imtitemRowsMap.get(itemno).size()) {
+                if (imtitemRowsMap.get(itemno).toRowsMap("stockno").size() != imtitemRowsMap.get(itemno).size()) {
                     iserr = true;
                     row.put("msg", "错误信息:本次导入存在重复商品");
                     rowserr.add(row);
@@ -209,6 +209,7 @@ public class u8prodpricedatail extends Controller {
         return getSucReturnObject().toString();
 
     }
+
     public XSSFSheet addSheet(ExcelFactory excelFactory, String sheetname, Rows datarows,
                               HashMap<String, String> titlemap) {
         ArrayList<String> keylist = datarows.getFieldList();
@@ -259,6 +260,7 @@ public class u8prodpricedatail extends Controller {
         }
         return sheet;
     }
+
     public static boolean isNumeric(String strNum) {
         if (strNum == null) {
             return false;