Browse Source

试用申请单撤回

wu 1 week ago
parent
commit
9f5a51dc49
2 changed files with 30 additions and 0 deletions
  1. 5 0
      src/custom/restcontroller/R.java
  2. 25 0
      src/custom/restcontroller/prsx/trial/trial.java

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

@@ -7567,6 +7567,11 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2025121610461102 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 25 - 0
src/custom/restcontroller/prsx/trial/trial.java

@@ -261,6 +261,31 @@ public class trial extends Controller {
         return getSucReturnObject().toString();
     }
 
+    @API(title = "撤回", apiversion = R.ID2025121610461102.v1.class)
+    public String unsubmit() throws YosException {
+        Long sa_trialid = content.getLong("sa_trialid");
+
+        Rows rows = getTrialRow(sa_trialid);
+        if (rows.isEmpty()) {
+            return getErrReturnObject().setErrMsg("试用申请不存在").toString();
+        }
+        if (!rows.get(0).getString("status").equals("提交")) {
+            return getErrReturnObject().setErrMsg("当前状态不可撤回").toString();
+        }
+
+        UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_trial");
+        updateSQL.setSiteid(siteid);
+        updateSQL.setUniqueid(sa_trialid);
+        updateSQL.setValue("status", "新建");
+        updateSQL.setValue("checkby", "null");
+        updateSQL.setValue("checkdate", "null");
+        updateSQL.update();
+
+        dbConnect.runSqlUpdate(DataContrlLog.createLog(this, "sa_trial", sa_trialid, "撤回", "撤回成功").getSQL());
+        return getSucReturnObject().toString();
+    }
+
+
     @API(title = "试用申请-审核", apiversion = R.ID2025110713430802.v1.class)
     public String check() throws YosException {
         Long sa_trialid = content.getLong("sa_trialid");