Explorar o código

修复分类选项创建时没有启用的错误

shenjingwei hai 2 meses
pai
achega
bd967ac76c

+ 1 - 1
pom.xml

@@ -92,7 +92,7 @@
         <dependency>
             <groupId>com.yunlian.yos</groupId>
             <artifactId>yos-core</artifactId>
-            <version>3.2.31</version>
+            <version>3.3.1</version>
         </dependency>
         <dependency>
             <groupId>com.microsoft.sqlserver</groupId>

+ 1 - 2
src/custom/restcontroller/webmanage/optiontype/custom/SQL/选项分类明细修改.sql

@@ -1,6 +1,5 @@
 update sys_optiontypemx
-set isused=$isused$,
-    value=$value$,
+set value=$value$,
     sequence=$sequence$,
     remarks=$remarks$,
     subvalues=$subvalues$

+ 1 - 1
src/custom/restcontroller/webmanage/optiontype/custom/SQL/选项分类明细新增.sql

@@ -2,7 +2,7 @@ insert into sys_optiontypemx(optiontypeid, optiontypemxid, isused, value, subval
                              remarks)
 select $optiontypeid$,
        $optiontypemxid$,
-       $isused$,
+       1,
        $value$,
        $subvalues$,
        $sequence$,

+ 0 - 3
src/custom/restcontroller/webmanage/optiontype/custom/customoptiontype.java

@@ -73,7 +73,6 @@ public class customoptiontype extends Controller {
     public String insertormodify_optiontypemx() throws YosException {
         long optiontypeid = content.getLong("optiontypeid");//分类ID,必填
         long optiontypemxid = content.getLong("optiontypemxid");//分类明细ID。新增传0
-        boolean isused = content.getBooleanValue("isused");
         String value = content.getString("value");
         JSONArray subvalues = new JSONArray();
         if (content.containsKey("subvalues")) {
@@ -93,7 +92,6 @@ public class customoptiontype extends Controller {
             sqlFactory = new SQLFactory(this, "选项分类明细新增");
             sqlFactory.addParameter("optiontypeid", optiontypeid);
             sqlFactory.addParameter("optiontypemxid", optiontypemxid);
-            sqlFactory.addParameter("isused", isused);
             sqlFactory.addParameter("value", value);
             sqlFactory.addParameter("subvalues", subvalues.toString());
             sqlFactory.addParameter("remarks", remarks);
@@ -106,7 +104,6 @@ public class customoptiontype extends Controller {
             sqlFactory = new SQLFactory(this, "选项分类明细修改");
             sqlFactory.addParameter("optiontypeid", optiontypeid);
             sqlFactory.addParameter("optiontypemxid", optiontypemxid);
-            sqlFactory.addParameter("isused", isused);
             sqlFactory.addParameter("value", value);
             sqlFactory.addParameter("subvalues", subvalues.toString());
             sqlFactory.addParameter("remarks", remarks);

+ 13 - 5
src/override/com/alibaba/fastjson/JSONObject.java

@@ -134,6 +134,11 @@ public class JSONObject
         return val;
     }
 
+    public JSONObject getJSONObjectValue(String key, JSONObject defaultvalue) {
+        JSONObject jsonObject = getJSONObject(key);
+        return jsonObject == null ? defaultvalue : jsonObject;
+    }
+
     public JSONObject getJSONObject(String key) {
         Object value = map.get(key);
         if (value instanceof JSONObject) {
@@ -415,6 +420,9 @@ public class JSONObject
     }
 
     public boolean getBooleanValue(String key) {
+        if (getStringValue(key).equals("1")) {
+            return true;
+        }
         return getBooleanValue(key, false);
     }
 
@@ -1000,7 +1008,7 @@ public class JSONObject
             String name = null;
             JSONField annotation = method.getAnnotation(JSONField.class);
             if (annotation != null) {
-                if (annotation.name().length() != 0) {
+                if (!annotation.name().isEmpty()) {
                     name = annotation.name();
                 }
             }
@@ -1013,7 +1021,7 @@ public class JSONObject
                 }
 
                 name = name.substring(3);
-                if (name.length() == 0) {
+                if (name.isEmpty()) {
                     throw new JSONException("illegal setter");
                 }
                 name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
@@ -1032,7 +1040,7 @@ public class JSONObject
             String name = null;
             JSONField annotation = method.getAnnotation(JSONField.class);
             if (annotation != null) {
-                if (annotation.name().length() != 0) {
+                if (!annotation.name().isEmpty()) {
                     name = annotation.name();
                 }
             }
@@ -1041,13 +1049,13 @@ public class JSONObject
                 name = method.getName();
                 if (name.startsWith("get")) {
                     name = name.substring(3);
-                    if (name.length() == 0) {
+                    if (name.isEmpty()) {
                         throw new JSONException("illegal getter");
                     }
                     name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
                 } else if (name.startsWith("is")) {
                     name = name.substring(2);
-                    if (name.length() == 0) {
+                    if (name.isEmpty()) {
                         throw new JSONException("illegal getter");
                     }
                     name = Character.toLowerCase(name.charAt(0)) + name.substring(1);

+ 2 - 2
src/resources/application.yaml

@@ -9,7 +9,7 @@ system:
   db:
     driver: "com.mysql.cj.jdbc.Driver"
     username: "root"
-    password: "123456"
-    url: "jdbc:mysql://127.0.0.1:3306/yos3"
+    password: "root"
+    url: "jdbc:mysql://127.0.0.1:2206/mdyos"
     #url: jdbc:mysql://host.docker.internal:3306/yos3
     servicename: "mysql80"