|
|
@@ -45,6 +45,7 @@ public class OrderFeeCalculatePlan1 extends DataFunction {
|
|
|
@Override
|
|
|
public int action() throws YosException {
|
|
|
//判断当前订单类型是否满足方案
|
|
|
+ System.err.println("start......");
|
|
|
Row orderRow = Order.getOrderRows(controller, sa_orderid).get(0);
|
|
|
String type = orderRow.getString("type");
|
|
|
//清空费用表
|
|
|
@@ -55,7 +56,13 @@ public class OrderFeeCalculatePlan1 extends DataFunction {
|
|
|
RowsMap itemRowsMap = queryDataFunction(controller, sa_orderid, this.getClass().getSimpleName()).toRowsMap("sys_datafunctionid");
|
|
|
//查询订单商品和方案
|
|
|
|
|
|
- Rows dfRows = dbConnect.runSqlQuery("select sys_datafunctionid from sys_datafunction WHERE classname='OrderFeeCalculatePlan1' and status='启用' ");
|
|
|
+// Rows dfRows = dbConnect.runSqlQuery("select sys_datafunctionid from sys_datafunction WHERE classname='OrderFeeCalculatePlan1' and status='启用' ");
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "查询订单方案");
|
|
|
+ sqlFactory.addParameter("siteid", controller.siteid);
|
|
|
+ sqlFactory.addParameter("sa_orderid", sa_orderid);
|
|
|
+ System.err.println(sqlFactory.getSQL());
|
|
|
+ Rows dfRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+
|
|
|
for (Row dfRow : dfRows) {
|
|
|
String sys_datafunctionid = dfRow.getString("sys_datafunctionid");
|
|
|
Rows itemRows = itemRowsMap.getOrDefault(sys_datafunctionid, new Rows());
|
|
|
@@ -78,7 +85,8 @@ public class OrderFeeCalculatePlan1 extends DataFunction {
|
|
|
|
|
|
|
|
|
if (!ordertype.contains(type)) {
|
|
|
- return super.action();
|
|
|
+ System.err.println("end2......");
|
|
|
+ continue;
|
|
|
}
|
|
|
|
|
|
BigDecimal bdUnitfee = unitfee;
|
|
|
@@ -136,6 +144,7 @@ public class OrderFeeCalculatePlan1 extends DataFunction {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ System.err.println(sqlList);
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
//调整最后一行数据
|
|
|
adjustLastData(itemRows, totalprice);
|
|
|
@@ -165,13 +174,14 @@ public class OrderFeeCalculatePlan1 extends DataFunction {
|
|
|
}
|
|
|
sqlList.add(getInsertSQL(row, totalprice).getSQL());
|
|
|
}
|
|
|
+ System.err.println(sqlList);
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ System.err.println("end......");
|
|
|
return super.action();
|
|
|
}
|
|
|
|