Prechádzať zdrojové kódy

Merge branch 'develop-green' of http://124.70.211.186:3000/wzg/CUCU2 into develop-green

hu 2 rokov pred
rodič
commit
d1f6e3d6be

+ 23 - 0
src/custom/function/OrderFeeCalculatePlan1.java

@@ -0,0 +1,23 @@
+package function;
+
+import common.DataFunction;
+import common.YosException;
+import common.annotation.Param;
+import common.data.Rows;
+
+/**
+ * 订单费用计算方案1
+ */
+public class OrderFeeCalculatePlan1 extends DataFunction {
+
+    @Param(paramname = "fee", remarks = "单位费用")
+    Double fee;
+
+    @Override
+    public int action() throws YosException {
+        System.err.println("fee:" + fee);
+
+
+        return super.action();
+    }
+}

+ 16 - 0
src/custom/restcontroller/R.java

@@ -5378,6 +5378,22 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20231208133902 {
+        public static class v1 {
+        }
+    }
+    public static class ID20231208134002 {
+        public static class v1 {
+        }
+    }
+    public static class ID20231208134102 {
+        public static class v1 {
+        }
+    }
+    public static class ID20231208134202 {
+        public static class v1 {
+        }
+    }
 
 }
 

+ 88 - 0
src/custom/restcontroller/webmanage/sale/order/OrderFeeCostPlan.java

@@ -0,0 +1,88 @@
+package restcontroller.webmanage.sale.order;
+
+import com.alibaba.fastjson.JSONObject;
+import com.huaweicloud.sdk.lts.v2.model.SqlAlarmRuleRespList;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.data.*;
+import io.swagger.annotations.Api;
+import restcontroller.R;
+
+/**
+ * 订单费用计算方案
+ */
+public class OrderFeeCostPlan extends Controller {
+    /**
+     * 构造函数
+     *
+     * @param content
+     */
+    public OrderFeeCostPlan(JSONObject content) throws YosException {
+        super(content);
+    }
+
+    @API(title = "查询可选定制方案列表", apiversion = R.ID20231208133902.v1.class)
+    public String customPlanList() throws YosException {
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_datafunction",
+                "sys_datafunctionid", "functionname", "remarks", "isused", "createdate");
+        //创建人写死admin
+        querySQL.addQueryFields("createby", "\'admin\'");
+        querySQL.setWhere("t1.functionclass", "ordercost");
+        querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting).setTableAlias("t1");
+        Rows rows = querySQL.query();
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+    @API(title = "绑定定制方案", apiversion = R.ID20231208134002.v1.class)
+    public String insertOrUpdatePlan() throws YosException {
+
+        Long sys_datafunctionid = content.getLongValue("sys_datafunctionid");
+        Long ownerid = content.getLongValue("ownerid");
+        String ownertable = content.getStringValue("ownertable");
+
+        Rows rows = dbConnect.runSqlQuery("SELECT * from sys_datafunction_bind WHERE ownerid=" + ownerid + " and ownertable='" + ownertable + "'");
+        if (rows.isEmpty()) {
+            InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_datafunction_bind");
+            insertSQL.setUniqueid(createTableID("sys_datafunction_bind"));
+            insertSQL.setValue("ownerid", ownerid);
+            insertSQL.setValue("ownertable", ownertable);
+            insertSQL.setValue("sys_datafunctionid", sys_datafunctionid);
+            insertSQL.insert();
+        } else {
+            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_datafunction_bind");
+            updateSQL.setUniqueid(rows.get(0).getLong("sys_datafunction_bindid"));
+            updateSQL.setValue("sys_datafunctionid", sys_datafunctionid);
+            updateSQL.update();
+        }
+
+
+        return getSucReturnObject().toString();
+    }
+
+    @API(title = "删除商品定制方案", apiversion = R.ID20231208134102.v1.class)
+    public String delete() throws YosException {
+        Long sys_datafunction_bindid = content.getLongValue("sys_datafunction_bindid");
+        DeleteSQL deleteSQL = SQLFactory.createDeleteSQL(this, "sys_datafunction_bind");
+        deleteSQL.setUniqueid(sys_datafunction_bindid);
+        deleteSQL.delete();
+        return getSucReturnObject().toString();
+    }
+
+    @API(title = "商品定制方案列表", apiversion = R.ID20231208134202.v1.class)
+    public String list() throws YosException {
+        Long ownerid = content.getLongValue("ownerid");
+        String ownertable = content.getStringValue("ownertable");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_datafunction_bind");
+        querySQL.addJoinTable(JOINTYPE.left, "sys_datafunction", "t2", "t2.sys_datafunctionid=t1.sys_datafunctionid"
+                , "functionname", "remarks", "isused", "createdate");
+        querySQL.setWhere("t1.ownerid", ownerid);
+        querySQL.setWhere("t1.ownertable", ownertable);
+        querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting).setTableAlias("t1");
+        Rows rows = querySQL.query();
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
+}