Selaa lähdekoodia

退货单审核状态下允许变更退款账户

hu 2 vuotta sitten
vanhempi
commit
7376687eea

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

@@ -4788,6 +4788,10 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20230706103703 {
+        public static class v1 {
+        }
+    }
 
 }
 

+ 8 - 0
src/custom/restcontroller/webmanage/sale/aftersalesmag/SQL/更新退货单退款账户.sql

@@ -0,0 +1,8 @@
+UPDATE sa_aftersalesmag
+SET
+    sa_accountclassid=$sa_accountclassid$
+WHERE sa_aftersalesmagid = $sa_aftersalesmagid$ and siteid=$siteid$
+
+
+
+

+ 27 - 0
src/custom/restcontroller/webmanage/sale/aftersalesmag/aftersalesmag.java

@@ -278,6 +278,33 @@ public class aftersalesmag extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+    @API(title = "更新退货单退款账户", apiversion = R.ID20230706103703.v1.class)
+    public String updateAccountclass() throws YosException {
+
+        Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
+        Long sa_accountclassid = content.getLong("sa_accountclassid");
+        Rows rows =dbConnect.runSqlQuery("select * from sa_aftersalesmag where sa_aftersalesmagid="+sa_aftersalesmagid+" and siteid='"+siteid+"'");
+        if(rows.isEmpty()){
+
+        }else{
+            if (!(rows.get(0).getString("status").equals("新建") || rows.get(0).getString("status").equals("审核"))) {
+                return getErrReturnObject().setErrMsg("非新建、审核状态无法修改退款账户").toString();
+            }
+        }
+
+
+        SQLFactory sqlFactory = new SQLFactory(this, "更新退货单退款账户");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("username", username);
+        sqlFactory.addParameter("userid", userid);
+        sqlFactory.addParameter("sa_aftersalesmagid", sa_aftersalesmagid);
+        sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
+        dbConnect.runSqlUpdate(sqlFactory);
+
+
+        return queryaftersalesmagMain();
+    }
+
     @API(title = "删除", apiversion = R.ID20230104160803.v1.class)
     @CACHEING_CLEAN(apiversions = {R.ID20230104160603.v1.class, R.ID20230104160703.v1.class, R.ID20230105161503.v1.class})
     public String delete() throws YosException {