|
|
@@ -165,7 +165,7 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
|
|
|
String sa_orderitems = "sa_orderitems";
|
|
|
|
|
|
- public InsertSQL getInsertSQL(JSONArray customproperties, long sa_orderitemsid, JSONObject item, Row itemRow, String type, BigDecimal defaultprice, BigDecimal price, BigDecimal marketprice) throws YosException {
|
|
|
+ public InsertSQL getInsertSQL(JSONArray customproperties, long sa_orderitemsid, JSONObject item, Row itemRow, String type, BigDecimal defaultprice, BigDecimal price,BigDecimal saleprice, BigDecimal marketprice) throws YosException {
|
|
|
Long itemid = item.getLong("itemid");
|
|
|
BigDecimal qty = item.getBigDecimalValue("qty");
|
|
|
|
|
|
@@ -236,6 +236,8 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
}
|
|
|
//单价,折后价(元),取合同价
|
|
|
insertSQL.setValue("defaultprice", defaultprice);
|
|
|
+ insertSQL.setValue("saleprice", saleprice);
|
|
|
+
|
|
|
//金额,折后金额(元)
|
|
|
insertSQL.setValue("defaultamount", defaultprice.multiply(qty));
|
|
|
//牌价、市场价(元),标准订单牌价取商品价格,项目订单取合同里的牌价
|
|
|
@@ -244,7 +246,7 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
return insertSQL;
|
|
|
}
|
|
|
|
|
|
- public UpdateSQL getUpdateSQL(long sa_orderitemsid, JSONObject item, Row itemRow, String type, BigDecimal defaultprice, BigDecimal price) throws YosException {
|
|
|
+ public UpdateSQL getUpdateSQL(long sa_orderitemsid, JSONObject item, Row itemRow, String type, BigDecimal defaultprice, BigDecimal price,BigDecimal saleprice) throws YosException {
|
|
|
BigDecimal qty = item.getBigDecimalValue("qty");
|
|
|
|
|
|
UpdateSQL updateSQL = SQLFactory.createUpdateSQL(controller, sa_orderitems);
|
|
|
@@ -305,7 +307,7 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
updateSQL.setValue("defaultprice", defaultprice);
|
|
|
//金额,折后金额(元)
|
|
|
updateSQL.setValue("defaultamount", defaultprice.multiply(qty));
|
|
|
-
|
|
|
+ updateSQL.setValue("saleprice", saleprice);
|
|
|
|
|
|
updateSQL.setWhere("siteid", controller.siteid);
|
|
|
updateSQL.setWhere("sa_orderitemsid", sa_orderitemsid);
|
|
|
@@ -348,6 +350,19 @@ public class OrderItemsHelper extends BaseClass {
|
|
|
|
|
|
return price;
|
|
|
}
|
|
|
+ public BigDecimal getSalePrice(Row orderRow, ItemPrice itemPrice) throws YosException {
|
|
|
+ String type = orderRow.getString("type");
|
|
|
+ Long sa_promotionid = orderRow.getLong("sa_promotionid");
|
|
|
+ BigDecimal price;
|
|
|
+ switch (type) {
|
|
|
+ case "促销订单":
|
|
|
+ price = itemPrice.getPromotionPrice(sa_promotionid);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ price = itemPrice.getGraderateprice();
|
|
|
+ }
|
|
|
|
|
|
+ return price;
|
|
|
+ }
|
|
|
|
|
|
}
|