|
@@ -366,6 +366,12 @@ public class itemgroup extends Controller {
|
|
|
RowsMap itemclassRowsMap = rowsitemclass.toRowsMap("itemid");
|
|
|
|
|
|
RowsMap itemextendRowsMap = dbConnect.runSqlQuery("select itemid,material,device,prodline,specalnote,pressure,connection,valveplatematerial,actuatortype,actuatorbrand,butterflyplatedrive from plm_itemextend where siteid='" + siteid + "'").toRowsMap("itemid");
|
|
|
+
|
|
|
+ SQLFactory priceSqlFactory = new SQLFactory(this, "查询商品原价");
|
|
|
+ priceSqlFactory.addParameter("sa_itemgroupid", sa_itemgroupid);
|
|
|
+ priceSqlFactory.addParameter("siteid", siteid);
|
|
|
+ Rows pricerows = dbConnect.runSqlQuery(priceSqlFactory);
|
|
|
+ RowsMap pricerowsMap = pricerows.toRowsMap("itemid");
|
|
|
for (Row row : rows) {
|
|
|
|
|
|
ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));
|
|
@@ -373,7 +379,15 @@ public class itemgroup extends Controller {
|
|
|
if (sys_enterpriseid > 0 || (usertype == 21 || usertype == 22)) {
|
|
|
row.put("gradeprice", itemPrice.getContractprice());
|
|
|
} else {
|
|
|
- row.put("gradeprice", itemPrice.getMarketprice());
|
|
|
+ if(pricerowsMap.containsKey(row.getString("itemid"))){
|
|
|
+ if(pricerowsMap.get(row.getString("itemid")).isNotEmpty()){
|
|
|
+ row.put("gradeprice", pricerowsMap.get(row.getString("itemid")).get(0).getBigDecimal("price"));
|
|
|
+ }else{
|
|
|
+ row.put("gradeprice",0);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ row.put("gradeprice", 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Rows jsonArray = new Rows();
|