|
|
@@ -3,10 +3,7 @@ package com.cnd3b.restcontroller.customer.wechatapplet;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyun.oss.HttpMethod;
|
|
|
-import com.aliyun.oss.model.GeneratePresignedUrlRequest;
|
|
|
-import com.aliyun.oss.model.ListObjectsRequest;
|
|
|
-import com.aliyun.oss.model.OSSObjectSummary;
|
|
|
-import com.aliyun.oss.model.ObjectListing;
|
|
|
+import com.aliyun.oss.model.*;
|
|
|
import com.cnd3b.common.Controller;
|
|
|
import com.cnd3b.common.data.Row;
|
|
|
import com.cnd3b.common.data.Rows;
|
|
|
@@ -19,6 +16,7 @@ import p2.common.parse.S;
|
|
|
import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSetRemote;
|
|
|
import p2.pao.R;
|
|
|
+import p2.pao.SqlFormat;
|
|
|
import p2.util.P2Exception;
|
|
|
|
|
|
import java.net.URI;
|
|
|
@@ -71,6 +69,7 @@ public class wechatapplet extends Controller {
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
|
|
|
+
|
|
|
return getSucReturnObject().setDataByPaging(rows).preloading(1).toString();
|
|
|
}
|
|
|
|
|
|
@@ -178,9 +177,9 @@ public class wechatapplet extends Controller {
|
|
|
String where = "";
|
|
|
//1表示业务员
|
|
|
if (fusertype.equals("1")) {
|
|
|
- where = "t1.fissaler ='1'";
|
|
|
+ where = "t1.fispublic in (0,2)";
|
|
|
} else {
|
|
|
- where = "t1.fisagent ='1'";
|
|
|
+ where = "t1.fispublic in (0,1) and t1.fisagent=0 ";
|
|
|
}
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "分类");
|
|
|
@@ -253,6 +252,10 @@ public class wechatapplet extends Controller {
|
|
|
ArrayList<String> keyStr = new ArrayList<>();
|
|
|
for (JSONObject object : listFolder) {
|
|
|
keyStr.add(object.getString("folderpath"));
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "插入文件夹");
|
|
|
+ sqlFactory.addParameter("fpath", object.getString("folderpath"));
|
|
|
+ sqlFactory.addParameter("tfolderid", createTableID("tfolder", "tfolderid"));
|
|
|
+ dbConnect.runSqlUpdate(sqlFactory);
|
|
|
}
|
|
|
SQLFactory sqlNameFac = new SQLFactory(this, "查询文件名称");
|
|
|
sqlNameFac.addParameter_in("fpath", keyStr);
|
|
|
@@ -718,16 +721,24 @@ public class wechatapplet extends Controller {
|
|
|
}
|
|
|
|
|
|
public ArrayList<JSONObject> getListFolder(ArrayList<JSONObject> listFolderAll, ArrayList<String> listUserFolders) {
|
|
|
+ ArrayList<String> fpathList = new ArrayList<>();
|
|
|
+ for (JSONObject object : listFolderAll) {
|
|
|
+ fpathList.add(object.getString("folderpath"));
|
|
|
+ }
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "查询是否有授权");
|
|
|
+ sqlFactory.addParameter_in("fpath", fpathList);
|
|
|
+ String sql = sqlFactory.getSQL();
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
+ if (rows.isEmpty()) {
|
|
|
+ return listFolderAll;
|
|
|
+ }
|
|
|
+
|
|
|
ArrayList<JSONObject> listFolder = new ArrayList<>();
|
|
|
for (JSONObject object : listFolderAll) {
|
|
|
String folderpath = object.getString("folderpath");
|
|
|
- if (listUserFolders.size() == 0) {
|
|
|
- listFolder.add(object);
|
|
|
- } else {
|
|
|
- for (String str : listUserFolders) {
|
|
|
- if (str.equals(folderpath)) {
|
|
|
- listFolder.add(object);
|
|
|
- }
|
|
|
+ for (String str : listUserFolders) {
|
|
|
+ if (str.equals(folderpath)) {
|
|
|
+ listFolder.add(object);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -735,16 +746,17 @@ public class wechatapplet extends Controller {
|
|
|
}
|
|
|
|
|
|
public ArrayList<JSONObject> getListFolder(ObjectListing listing, ArrayList<String> listUserFolders, ArrayList<String> listRole, ArrayList<String> listfauthtype) {
|
|
|
+ //查询oss上的文件夹目录
|
|
|
ArrayList<JSONObject> listFolderAll = getListFolderAll(listing);
|
|
|
ArrayList<JSONObject> listFolder = getListFolder(listFolderAll, listUserFolders);
|
|
|
- if (listFolder.size() == 0) {
|
|
|
- listFolder = listFolderAll;
|
|
|
- } else {
|
|
|
- if (fusertype.equals("经销商")) {
|
|
|
- //开启双向验证
|
|
|
- listFolder = check(listFolder, listRole, listfauthtype);
|
|
|
- }
|
|
|
- }
|
|
|
+// if (listFolder.size() == 0) {
|
|
|
+// listFolder = listFolderAll;
|
|
|
+// } else {
|
|
|
+//// if (fusertype.equals("经销商")) {
|
|
|
+//// //开启双向验证
|
|
|
+//// listFolder = check(listFolder, listRole, listfauthtype);
|
|
|
+//// }
|
|
|
+// }
|
|
|
return listFolder;
|
|
|
}
|
|
|
|