|
@@ -360,6 +360,14 @@ public class OrderItems extends Controller {
|
|
|
@CACHEING_CLEAN(apiClass = {Order.class, OrderItems.class, restcontroller.sale.order.Order.class, ToolBill.class})
|
|
|
public String delete() throws YosException {
|
|
|
Long sa_orderid = content.getLong("sa_orderid");
|
|
|
+ Rows orderRows = getOrderRows(this, sa_orderid);
|
|
|
+ if (orderRows.isEmpty()) {
|
|
|
+ return getErrReturnObject().setErrMsg("数据不存在,无法添加").toString();
|
|
|
+ } else {
|
|
|
+ if (!orderRows.get(0).getString("status").equals("新建")) {
|
|
|
+ return getErrReturnObject().setErrMsg("非新建状态无法删除").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
JSONArray sa_orderitemsids = content.getJSONArray("sa_orderitemsids");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "订单商品明细_删除");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
@@ -371,7 +379,6 @@ public class OrderItems extends Controller {
|
|
|
//居间费设置
|
|
|
updateRebateFee(sa_orderid);
|
|
|
//调整价格(返利金)
|
|
|
- Rows orderRows = getOrderRows(this, sa_orderid);
|
|
|
if (orderRows.get(0).getBoolean("rebate_used")) {
|
|
|
setRebateAmount(this, sa_orderid, getMaxUsedRebateAmount(this, sa_orderid));
|
|
|
adjustLastRebateAmount(this, sa_orderid);
|