|
@@ -279,6 +279,8 @@ public class FadGoods extends Controller {
|
|
|
|
|
|
@API(title = "获取门店商品列表", apiversion = R.ID20240430094102.v1.class)
|
|
|
public String getStoreList() throws YosException {
|
|
|
+
|
|
|
+ Long iscollect = 0L;
|
|
|
/*
|
|
|
过滤条件设置
|
|
|
*/
|
|
@@ -311,6 +313,8 @@ public class FadGoods extends Controller {
|
|
|
where.append(" and (");
|
|
|
where.append(" t1.sa_fadid in (SELECT ownerid from sys_datacollect WHERE ownertable='sa_fad' and type=1 and siteid='" + siteid + "' and userid=" + userid + ")");
|
|
|
where.append(")");
|
|
|
+
|
|
|
+ iscollect = whereObject.getLongValue("iscollect");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -324,9 +328,12 @@ public class FadGoods extends Controller {
|
|
|
return getSucReturnObject().setData(new Rows()).toString();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- LinkedHashSet<Long> saleareaidsPath = userInfo.getSaleareaidsPath(this, sys_enterpriseid);
|
|
|
- String wheresql = "t1.sa_fadid in (SELECT ownerid from sys_dataauths WHERE ownertable='sa_fad' and (sys_enterpriseid =" + sys_enterpriseid + " or sa_saleareaid in " + saleareaidsPath + "))";
|
|
|
+ String wheresql = "";
|
|
|
+ if (iscollect == 0) {
|
|
|
+ LinkedHashSet<Long> saleareaidsPath = userInfo.getSaleareaidsPath(this, sys_enterpriseid);
|
|
|
+ wheresql = "t1.sa_fadid in (SELECT ownerid from sys_dataauths WHERE ownertable='sa_fad' and (sys_enterpriseid =" + sys_enterpriseid + " or sa_saleareaid in " + saleareaidsPath + "))";
|
|
|
+ wheresql = wheresql.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, sa_fad,
|
|
|
"sa_fadid", "name", "unitname")
|
|
@@ -337,7 +344,7 @@ public class FadGoods extends Controller {
|
|
|
querySQL.addQueryFields("price_deposit", "case when t2.sa_fadadjustid>0 then t2.price_deposit else t1.price_deposit end");
|
|
|
querySQL.addQueryFields("tag", "case when t2.sa_fadadjustid>0 then t2.tag else t1.tag end");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere(wheresql.replace("[", "(").replace("]", ")"));
|
|
|
+ querySQL.setWhere(iscollect == 1 ? "1=1" : wheresql);
|
|
|
querySQL.setWhere("classid", 2);
|
|
|
querySQL.setWhere("t1.isonsale=1 and (t2.isonsale=1 or t2.isonsale is null)");
|
|
|
querySQL.setWhere(where.toString());
|