|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cnd3b.restcontroller.system.system;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyun.oss.OSS;
|
|
|
import com.aliyun.oss.OSSClientBuilder;
|
|
|
@@ -7,6 +8,7 @@ import com.aliyun.oss.model.*;
|
|
|
import com.cnd3b.common.Controller;
|
|
|
import com.cnd3b.utility.FileTypeHelper;
|
|
|
import com.cnd3b.utility.aliyun.oss.AliyunOSSConfigConstant;
|
|
|
+import org.bytedeco.javacpp.presets.opencv_core;
|
|
|
import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSetRemote;
|
|
|
import p2.util.P2Exception;
|
|
|
@@ -256,11 +258,13 @@ public class OSSManage extends Controller {
|
|
|
//附件id
|
|
|
String tattachmentid = content.getString("tattachmentid");
|
|
|
String name = content.getString("filename");
|
|
|
+// int sort = content.getIntValue("sort");
|
|
|
//更新附件信息到附件表
|
|
|
PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tattachment", "tattachmentid = '" + tattachmentid + "'");
|
|
|
if (!paoSetRemote.isEmpty()) {
|
|
|
PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
paoRemote.setValue("ftitle", name, 11L);
|
|
|
+// paoRemote.setValue("sort", sort, 11L);
|
|
|
paoSetRemote.save();
|
|
|
} else {
|
|
|
return getErrReturnObject().setErrMsg("附件不存在").toString();
|
|
|
@@ -269,6 +273,23 @@ public class OSSManage extends Controller {
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
|
+ //批量更新序号
|
|
|
+ public String updateSort() throws P2Exception {
|
|
|
+ //附件id
|
|
|
+ JSONArray tattachmentids = content.getJSONArray("tattachmentids");
|
|
|
+
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+ int sort = 1;
|
|
|
+ for (Object obj : tattachmentids) {
|
|
|
+ sqlList.add(" UPDATE tattachment SET sort = " + sort + " WHERE tattachmentid=" + obj);
|
|
|
+ sort++;
|
|
|
+ }
|
|
|
+
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取现在时间
|
|
|
*
|