Преглед изворни кода

企业业绩目标(指定经销商)逻辑优化及购物车列表添加custamount

hu пре 6 месеци
родитељ
комит
907af0bfd4

+ 4 - 4
src/custom/restcontroller/sale/salestarget/enterprise.java

@@ -314,6 +314,7 @@ public class enterprise extends Controller {
 
         for(Row row :rows){
             Rows actualRows = new Rows();
+            row = addActualRow(row);
             String assessmentindicators = row.getString("assessmentindicators");
             //统计维度
             String statisticaldimension = row.getString("statisticaldimension");
@@ -423,15 +424,14 @@ public class enterprise extends Controller {
                 actualRows = dbConnect.runSqlQuery(sqlFactory);
             }
 
-            RowsMap rowsMap = actualRows.toRowsMap("year");
 
             for (Row tempActualRow : actualRows) {
                 Row actualRow = new Row();
-                if (rowsMap.containsKey(tempActualRow.getLong("year"))) {
+                if (tempActualRow.getLong("year")==row.getLong("year")) {
                     actualRow.putAll(tempActualRow);
                 }
-                rowsMap.get(tempActualRow.getLong("year")).get(0).putAll(actualRow);
-                rowsMap.get(tempActualRow.getLong("year")).get(0).putAll(calculate(rowsMap.get(tempActualRow.getLong("year")).get(0), actualRow));
+                row.putAll(actualRow);
+                row.putAll(calculate(row, actualRow));
             }
         }
 

+ 2 - 1
src/custom/restcontroller/sale/shoppingcart/SQL/购物车列表.sql

@@ -30,7 +30,8 @@ SELECT t1.sa_shoppingcartid,
        t3.colorschemeid,
        t3.cheekschemeid,
        if(t1.sa_promotionid>0,ifnull(t7.packageqty,0),ifnull(t3.packageqty,0)) packageqty,
-       t3.sa_customschemeid
+       t3.sa_customschemeid,
+       t3.custamount
 FROM sa_shoppingcart t1
          LEFT JOIN sa_brand t2 ON t2.sa_brandid = t1.sa_brandid AND t2.siteid = t1.siteid
          LEFT JOIN plm_item t3 ON t3.itemid = t1.itemid AND t3.siteid = t1.siteid