|
|
@@ -322,23 +322,55 @@ public class tagents extends Controller {
|
|
|
*/
|
|
|
public String addHotAgents() throws P2Exception {
|
|
|
|
|
|
- String tagentsid = content.getString("tagentsid");
|
|
|
+ String fname = content.getString("fname");
|
|
|
+ String ftype = content.getString("ftype");
|
|
|
String frownum = content.getString("frownum");
|
|
|
|
|
|
- PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("texcellentagents", "tagentsid = '" + tagentsid + "' OR frownum = '" + frownum + "'", "changedate");
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("texcellentagents", " ftype = '" + ftype + "' AND frownum = '" + frownum + "'");
|
|
|
if (paoSetRemote.isEmpty()) {
|
|
|
PaoRemote paoRemote = paoSetRemote.addAtEnd();
|
|
|
paoRemote.setValue("texcellentagentsid", paoRemote.getUniqueIDValue(), 11L);
|
|
|
- paoRemote.setValue("tagentsid", tagentsid);
|
|
|
+ paoRemote.setValue("fname", fname);
|
|
|
+ paoRemote.setValue("ftype", ftype);
|
|
|
paoRemote.setValue("frownum", frownum);
|
|
|
paoSetRemote.save();
|
|
|
return getSucReturnObject().toString();
|
|
|
} else {
|
|
|
- return getErrReturnObject().setErrMsg("商户已存在或者当前排序以设置对应商户").toString();
|
|
|
+
|
|
|
+
|
|
|
+ return getErrReturnObject().setErrMsg("当前类型的排序已存在,无法添加").toString();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新热门商户
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws P2Exception
|
|
|
+ */
|
|
|
+ public String updateHotAgents() throws P2Exception {
|
|
|
+ String texcellentagentsid = content.getString("texcellentagentsid");
|
|
|
+ String fname = content.getString("fname");
|
|
|
+ String ftype = content.getString("ftype");
|
|
|
+ String frownum = content.getString("frownum");
|
|
|
+
|
|
|
+ PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("texcellentagents", " texcellentagentsid = '" + texcellentagentsid + "'");
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
+ PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
+
|
|
|
+ paoRemote.setValue("fname", fname);
|
|
|
+ paoRemote.setValue("ftype", ftype);
|
|
|
+ paoRemote.setValue("frownum", frownum);
|
|
|
+ paoSetRemote.save();
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ return getErrReturnObject().setErrMsg("未找到对应的数据").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除热门商户
|
|
|
*
|
|
|
@@ -366,22 +398,22 @@ public class tagents extends Controller {
|
|
|
*/
|
|
|
public String getHotAgentsList() {
|
|
|
SQLFactory agentlistSql = null;
|
|
|
- if (content.containsKey("saleprodclass") && !"".equals(content.getString("saleprodclass"))) {
|
|
|
- String saleprodclass = content.getString("saleprodclass");
|
|
|
+ if (content.containsKey("ftype") && !"".equals(content.getString("ftype"))) {
|
|
|
+ String ftype = content.getString("ftype");
|
|
|
agentlistSql = new SQLFactory(this, "热门商户列表", pageSize, pageNumber, "t1.frownum");
|
|
|
- agentlistSql.addParameter("saleprodclass", saleprodclass);
|
|
|
+ agentlistSql.addParameter("ftype", ftype);
|
|
|
agentlistSql.addParameter("siteid", siteid);
|
|
|
} else {
|
|
|
- agentlistSql = new SQLFactory(this, "热门商户列表_全部", pageSize, pageNumber, "t1.frownum");
|
|
|
+ agentlistSql = new SQLFactory(this, "热门商户列表_全部", pageSize, pageNumber, "t1.ftype,1.frownum");
|
|
|
agentlistSql.addParameter("siteid", siteid);
|
|
|
}
|
|
|
|
|
|
System.err.println(agentlistSql.getSQL());
|
|
|
Rows rows = dbConnect.runSqlQuery(agentlistSql.getSQL());
|
|
|
- RowsMap map = getAttachmentUrl("tagents", rows.toArrayList("tagentsid"));
|
|
|
+ RowsMap map = getAttachmentUrl("texcellentagents", rows.toArrayList("texcellentagentsid"));
|
|
|
for (Row row : rows) {
|
|
|
- row.put("attinfos", map.get(row.getString("tagentsid")));
|
|
|
- row.put("saleprodclass", JSONArray.parseArray(row.getString("saleprodclass")));
|
|
|
+ row.put("attinfos", map.get(row.getString("texcellentagentsid")));
|
|
|
+
|
|
|
}
|
|
|
return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
|
|
|
|