|
|
@@ -60,6 +60,7 @@ public class OrderItems extends Controller {
|
|
|
if (orderRows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("数据不存在,无法添加").toString();
|
|
|
}
|
|
|
+ BigDecimal data =BigDecimal.ZERO;
|
|
|
|
|
|
// sa_contractid = orderRows.get(0).getLong("sa_contractid");
|
|
|
|
|
|
@@ -217,10 +218,12 @@ public class OrderItems extends Controller {
|
|
|
if (item.containsKey("defaultprice")) {
|
|
|
if (item.getBigDecimalValue("price").compareTo(BigDecimal.ZERO) > 0 && item.getBigDecimalValue("amount").compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
sqlFactory.addParameter("price", item.getBigDecimalValue("price"));
|
|
|
+ data=price.multiply(qty);
|
|
|
//折前金额(元)
|
|
|
sqlFactory.addParameter("amount", price.multiply(qty));
|
|
|
} else if (item.getBigDecimalValue("price").compareTo(BigDecimal.ZERO) <= 0 && item.getBigDecimalValue("amount").compareTo(BigDecimal.ZERO) > 0) {
|
|
|
sqlFactory.addParameter("price", item.getBigDecimalValue("amount").divide(qty, 6, BigDecimal.ROUND_HALF_UP));
|
|
|
+ data=item.getBigDecimalValue("amount").divide(qty, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
//折前金额(元)
|
|
|
sqlFactory.addParameter("amount", item.getBigDecimalValue("amount"));
|
|
|
} else {
|
|
|
@@ -276,7 +279,7 @@ public class OrderItems extends Controller {
|
|
|
// dbConnect.runSqlUpdate("UPDATE sa_orderitems SET amount=amount-rebateamount,price=amount/qty WHERE sa_orderid='" + sa_orderid + "' and siteid='" + siteid + "' and qty!=0");
|
|
|
// dbConnect.runSqlUpdate("UPDATE sa_orderitems SET amount=0 WHERE sa_orderid='" + sa_orderid + "' and siteid='" + siteid + "' and qty=0");
|
|
|
// }
|
|
|
- return getSucReturnObject().toString();
|
|
|
+ return getSucReturnObject().setData(data).toString();
|
|
|
}
|
|
|
|
|
|
/**
|