|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cnd3b.restcontroller.publicmethod.homepage;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.cnd3b.common.Controller;
|
|
|
import com.cnd3b.common.data.Row;
|
|
|
@@ -18,6 +19,7 @@ public class homepage extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String getStatisticalData() {
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "统计数据展示");
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
|
|
|
@@ -30,7 +32,8 @@ public class homepage extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_typeselectList() {
|
|
|
- Rows rows = dbConnect.runSqlQuery("select ttypedetailid,fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='BWJ' and fisused=1 order by sequence");
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select ttypedetailid,fvalue as ftype from ttypedetail where ftype = '供需分类' and siteid ='"+siteid+"' and fisused=1 order by sequence");
|
|
|
RowsMap map = getAttachmentUrl("ttypedetail", rows.toArrayList("ttypedetailid"));
|
|
|
for (Row row : rows) {
|
|
|
row.put("attinfos", map.get(row.getString("ttypedetailid")));
|
|
|
@@ -44,6 +47,7 @@ public class homepage extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_supplyanddemandList() {
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
/**
|
|
|
*排序条件设置
|
|
|
*/
|
|
|
@@ -60,7 +64,7 @@ public class homepage extends Controller {
|
|
|
}
|
|
|
}
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
|
|
|
- sqlFactory.addParameter("siteid", "BWJ");
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
@@ -78,11 +82,12 @@ public class homepage extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_supplyanddemandMain() {
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
|
|
|
long tagentsid = content.getLong("tagentsid");
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
|
|
|
- sqlFactory.addParameter("siteid", "BWJ");
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("tagentsid", tagentsid);
|
|
|
sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
@@ -94,29 +99,47 @@ public class homepage extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 热门商户
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public String agentList() {
|
|
|
- SQLFactory agentlistSql = new SQLFactory(this, "热门展商");
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
+ SQLFactory agentlistSql = new SQLFactory(this, "优质商户");
|
|
|
Rows rows = agentlistSql.runSqlQuery();
|
|
|
- RowsMap map = getAttachmentUrl("tactivity_agentmsg", rows.toArrayList("tactivity_agentmsgid"));
|
|
|
+ RowsMap map = getAttachmentUrl("tagents", rows.toArrayList("tagentsid"));
|
|
|
for (Row row : rows) {
|
|
|
- row.put("attinfos", map.get(row.getString("tactivity_agentmsgid")));
|
|
|
+ row.put("attinfos", map.get(row.getString("tagentsid")));
|
|
|
}
|
|
|
return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 热门商户详情查询
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String agentsMain() {
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
+ SQLFactory sql = new SQLFactory(this, "优质商户详情");
|
|
|
+ sql.addParameter("tagentsid", content.getString("tagentsid"));
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sql.getSQL());
|
|
|
+ for (Row row : rows) {
|
|
|
+ row.put("saleprodclass", JSONArray.parseArray(row.getString("saleprodclass")));
|
|
|
+ row.put("attinfos", getAttachmentUrl("tagents", content.getString("tagentsid")));
|
|
|
+ }
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 热门商品
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public String prodList() {
|
|
|
- SQLFactory agentlistSql = new SQLFactory(this, "热门展品");
|
|
|
+ this.siteid = content.getString("siteid");
|
|
|
+ SQLFactory agentlistSql = new SQLFactory(this, "优质商品");
|
|
|
Rows rows = agentlistSql.runSqlQuery();
|
|
|
RowsMap map = getAttachmentUrl("tagents_product", rows.toArrayList("tagents_productid"));
|
|
|
for (Row row : rows) {
|