|
@@ -3,10 +3,7 @@ package beans.order;
|
|
|
import common.BaseClass;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
-import common.data.QuerySQL;
|
|
|
-import common.data.Rows;
|
|
|
-import common.data.RowsMap;
|
|
|
-import common.data.SQLFactory;
|
|
|
+import common.data.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
@@ -25,26 +22,34 @@ public class OrderCost extends BaseClass {
|
|
|
//退款规则:是否可退款
|
|
|
public static void calculateCostAmount(Controller controller, Long sa_orderid) throws YosException {
|
|
|
//查询商品是否存在方案
|
|
|
- Rows rows = queryDataFunction(controller, sa_orderid);
|
|
|
+ Rows rows = queryDataFunction(controller, sa_orderid, "OrderFeeCalculatePlan1");
|
|
|
if (rows.isEmpty()) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ RowsMap dfRowsMap = rows.toRowsMap("sys_datafunctionid");
|
|
|
|
|
|
|
|
|
+ Row OrderRow = Order.getOrderRows(controller, sa_orderid).get(0);
|
|
|
+ //组合,不累加,分摊
|
|
|
+ //组合,累加,分摊
|
|
|
+ //不组合,不累加
|
|
|
+ //不组合,累加
|
|
|
+
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//查询订单的商品方案
|
|
|
- public static Rows queryDataFunction(Controller controller, Long sa_orderid) throws YosException {
|
|
|
+ public static Rows queryDataFunction(Controller controller, Long sa_orderid, String classname) throws YosException {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(controller, "sa_orderitems",
|
|
|
"sa_orderid", "sa_orderitemsid", "itemid");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sys_datafunction_bind", "t2", "t2.ownerid=t1.itemid and t2.ownertable='plm_item'",
|
|
|
"sys_datafunctionid");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sys_datafunction", "t3", "sys_datafunctionid=t2.sys_datafunctionid",
|
|
|
- "functionname");
|
|
|
+ "functionname", "classname");
|
|
|
querySQL.setWhere("t1.sa_orderid", sa_orderid);
|
|
|
+ querySQL.setWhere("t3.classname", classname);
|
|
|
querySQL.setTableAlias("t1");
|
|
|
return querySQL.query();
|
|
|
}
|