Sfoglia il codice sorgente

商品档案添加销售单价字段及详情添加等级价格

hu 1 anno fa
parent
commit
ac303ce5ba

+ 7 - 0
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -195,6 +195,7 @@ public class Item extends Controller {
         //德莱宝,选项定义方案id
         sqlFactory.addParameter("materialschemeid", content.getBigDecimalValue("materialschemeid"));
 
+        sqlFactory.addParameter("saleprice", content.getBigDecimalValue("saleprice"));
         sqlFactory.addParameter("cost", content.getBigDecimalValue("cost"));
         sqlFactory.addParameter("grossprofit", content.getBigDecimalValue("grossprofit"));
         sqlFactory.addParameter("grossprofitmargin", content.getBigDecimalValue("grossprofitmargin"));
@@ -359,6 +360,7 @@ public class Item extends Controller {
         String result = "";
 //        String result = request.doPost(object.toString(),
 //                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
+        Rows siteParameterRows =dbConnect.runSqlQuery("select * from sys_site_parameter where siteid='" + siteid + "'");
         for (Row row : rows) {
             JSONArray jsonArrayResult = new JSONArray();
             if (isJSONArray(result)) {
@@ -377,6 +379,11 @@ public class Item extends Controller {
             row.put("brand", brandRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
             row.put("itemclass", itemClassRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
             row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
+            if (siteParameterRows.isNotEmpty()) {
+                row.put("defaultlevelprice",siteParameterRows.get(0).getString("defaultlevelprice"));
+            }else{
+                row.put("defaultlevelprice","");
+            }
         }
 
         return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();

+ 1 - 0
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案列表.sql

@@ -37,6 +37,7 @@ SELECT t1.itemid,
        t1.iscustomsize,
        t1.customprice,
        t1.pricingmetod,
+       t1.saleprice,
        t1.cost,
        t1.grossprofit,
        t1.grossprofitmargin,

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案新增.sql

@@ -4,11 +4,11 @@ insert into plm_item (siteid, itemid, createby, createdate, changeuserid, change
                       weight, height, width, length, delivery, istool, marketprice, standards, stockstatus2,
                       stockstatus1, warrantyday, iswuliao, isservice, color, packageqty, ismodule, iswoodproducts,
                       sa_customschemeid, cheek, delistingstatus, financeclasstype, stockno, volume, marketingcategory,
-                      pricingmetod,cheekschemeid,colorschemeid,materialschemeid,cost,grossprofit,grossprofitmargin)
+                      pricingmetod,cheekschemeid,colorschemeid,materialschemeid,cost,grossprofit,grossprofitmargin,saleprice)
 values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURRENT_TIME, $itemno$, $unitid$,
         $isauxunit$, $unitgroupid$, $itemname$, $isonsale$, '新建', $model$, $spec$, $orderminqty$, $orderaddqty$,
         $orderminqty_auxunit$, $orderaddqty_auxunit$, $remarks$, $barcode$, $skucontrol$, $batchcontrol$, $grossweight$,
         $weight$, $height$, $width$, $length$, $delivery$, $istool$, $marketprice$, $standards$,
         $stockstatus2$, $stockstatus1$, $warrantyday$, $iswuliao$, $isservice$, $color$, $packageqty$, $ismodule$,
         $iswoodproducts$, $sa_customschemeid$, $cheek$, $delistingstatus$, $financeclasstype$, $stockno$, $volume$,
-        $marketingcategory$, $pricingmetod$,$cheekschemeid$,$colorschemeid$,$materialschemeid$,$cost,$grossprofit$,$grossprofitmargin$)
+        $marketingcategory$, $pricingmetod$,$cheekschemeid$,$colorschemeid$,$materialschemeid$,$cost,$grossprofit$,$grossprofitmargin$,$saleprice$)

+ 1 - 0
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案更新.sql

@@ -53,6 +53,7 @@ SET changeuserid=$userid$,
     materialschemeid=$materialschemeid$,
     cost=$cost$,
     grossprofit=$grossprofit$,
+    saleprice=$saleprice$,
     grossprofitmargin=$grossprofitmargin$
 WHERE itemid = $itemid$
   and siteid = $siteid$

+ 11 - 1
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案详情.sql

@@ -23,7 +23,12 @@ SELECT t1.*,
        ifnull(t3.qty, 0)   invbal_qty,
        t4.schemename widthschemename,
        t5.schemename lengthschemename,
-       t6.schemename
+       t6.schemename,
+       t9.price price1,
+       t10.price price2,
+       t11.price price3,
+       t12.price price4,
+       t13.price price5
 FROM plm_item t1
          LEFT JOIN plm_unit t2 ON t2.unitid = t1.unitid AND t2.siteid = t1.siteid
          LEFT JOIN plm_itemextend t8 ON t8.itemid = t1.itemid AND t8.siteid = t1.siteid
@@ -31,5 +36,10 @@ FROM plm_item t1
          left join sa_sizecustomizedscheme t4 on t1.widthschemeid=t4.sa_sizecustomizedschemeid and t1.siteid=t4.siteid
          left join sa_sizecustomizedscheme t5 on t1.lengthschemeid=t5.sa_sizecustomizedschemeid and t1.siteid=t5.siteid
          left join sa_customscheme t6 on t1.sa_customschemeid=t6.sa_customschemeid and t1.siteid=t6.siteid
+         left join sa_itemprice t9 on t9.itemid = t1.itemid AND t9.siteid = t1.siteid and t9.pricegrade=1
+         left join sa_itemprice t10 on t10.itemid = t1.itemid AND t10.siteid = t1.siteid and t10.pricegrade=2
+         left join sa_itemprice t11 on t11.itemid = t1.itemid AND t11.siteid = t1.siteid and t11.pricegrade=3
+         left join sa_itemprice t12 on t12.itemid = t1.itemid AND t12.siteid = t1.siteid and t12.pricegrade=4
+         left join sa_itemprice t13 on t12.itemid = t1.itemid AND t12.siteid = t1.siteid and t12.pricegrade=5
 WHERE t1.siteid = $siteid$
   and t1.itemid = $itemid$