|
@@ -214,13 +214,13 @@ public class LongPicText extends Controller {
|
|
|
ArrayList<Long> ids = new ArrayList<>();
|
|
|
for (Object o : jsonArray) {
|
|
|
JSONObject jsonObject1 = (JSONObject) o;
|
|
|
- ids.add(jsonObject1.getLongValue("attchementid"));
|
|
|
+ ids.add(jsonObject1.getLongValue("attachmentid"));
|
|
|
}
|
|
|
|
|
|
RowsMap attRowsMap = Attachment.get(this, ids).toRowsMap("attachmentid");
|
|
|
for (Object object : jsonArray) {
|
|
|
JSONObject jsonObject1 = (JSONObject) object;
|
|
|
- jsonObject1.put("attinfos", attRowsMap.getOrDefault(jsonObject1.getString("attchementid"), new Rows()));
|
|
|
+ jsonObject1.put("attinfos", attRowsMap.getOrDefault(jsonObject1.getString("attachmentid"), new Rows()));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -232,7 +232,7 @@ public class LongPicText extends Controller {
|
|
|
public String updatePicInfo() throws YosException {
|
|
|
|
|
|
Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
|
|
|
- Long attchementid = content.getLongValue("attchementid");
|
|
|
+ Long attachmentid = content.getLongValue("attachmentid");
|
|
|
|
|
|
Rows rows = dbConnect.runSqlQuery("SELECT * from sat_sharematerial WHERE sat_sharematerialid=" + sat_sharematerialid + " and siteid='" + siteid + "'");
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -241,10 +241,10 @@ public class LongPicText extends Controller {
|
|
|
jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
|
|
|
jsonArray = jsonObject.getJSONArray("pics");
|
|
|
}
|
|
|
- JSONArray newjsonArray = getTempJSONArray(jsonArray, String.valueOf(attchementid));
|
|
|
+ JSONArray newjsonArray = getTempJSONArray(jsonArray, String.valueOf(attachmentid));
|
|
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
- object.put("attchementid", attchementid);
|
|
|
+ object.put("attachmentid", attachmentid);
|
|
|
object.put("url", content.getStringValue("url"));
|
|
|
object.put("sequence", content.getIntValue("sequence"));
|
|
|
newjsonArray.add(object);
|
|
@@ -259,7 +259,7 @@ public class LongPicText extends Controller {
|
|
|
updateSQL.update();
|
|
|
|
|
|
|
|
|
- object.put("attinfos", Attachment.get(this, attchementid));
|
|
|
+ object.put("attinfos", Attachment.get(this, attachmentid));
|
|
|
|
|
|
|
|
|
return getSucReturnObject().setData(object).toString();
|
|
@@ -269,7 +269,7 @@ public class LongPicText extends Controller {
|
|
|
public String deletePicInfo() throws YosException {
|
|
|
|
|
|
Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
|
|
|
- Long attchementid = content.getLongValue("attchementid");
|
|
|
+ Long attachmentid = content.getLongValue("attachmentid");
|
|
|
|
|
|
Rows rows = dbConnect.runSqlQuery("SELECT * from sat_sharematerial WHERE sat_sharematerialid=" + sat_sharematerialid + " and siteid='" + siteid + "'");
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -278,7 +278,7 @@ public class LongPicText extends Controller {
|
|
|
jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
|
|
|
jsonArray = jsonObject.getJSONArray("pics");
|
|
|
}
|
|
|
- jsonObject.put("pics", getTempJSONArray(jsonArray, String.valueOf(attchementid)));
|
|
|
+ jsonObject.put("pics", getTempJSONArray(jsonArray, String.valueOf(attachmentid)));
|
|
|
|
|
|
|
|
|
UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_sharematerial");
|
|
@@ -293,11 +293,11 @@ public class LongPicText extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public JSONArray getTempJSONArray(JSONArray jsonArray, String attchementid) throws YosException {
|
|
|
+ public JSONArray getTempJSONArray(JSONArray jsonArray, String attachmentid) throws YosException {
|
|
|
JSONArray temp = new JSONArray();
|
|
|
for (Object object : jsonArray) {
|
|
|
JSONObject temp_object = (JSONObject) object;
|
|
|
- if (!temp_object.getString("attchementid").equals(attchementid)) {
|
|
|
+ if (!temp_object.getString("attachmentid").equals(attachmentid)) {
|
|
|
temp.add(object);
|
|
|
}
|
|
|
}
|