|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.cnd3b.common.Controller;
|
|
|
import com.cnd3b.common.D3bException;
|
|
|
+import com.cnd3b.common.data.Row;
|
|
|
import com.cnd3b.common.data.Rows;
|
|
|
import com.cnd3b.common.data.SQLFactory;
|
|
|
import com.cnd3b.common.data.db.DataPool;
|
|
|
@@ -12,6 +13,8 @@ import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSetRemote;
|
|
|
import p2.util.P2Exception;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
public class tagents extends Controller {
|
|
|
@@ -81,10 +84,18 @@ public class tagents extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String query_enterpriseAgentsMain() {
|
|
|
+ tagentsid = content.getLong("tagentsid");
|
|
|
SQLFactory sql = new SQLFactory(this, "经销商主界面查询");
|
|
|
sql.addParameter("siteid", siteid);
|
|
|
- sql.addParameter("tagentsid", content.getString("tagentsid"));
|
|
|
+ sql.addParameter("tagentsid", tagentsid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sql.getSQL());
|
|
|
+ for (Row row : rows) {
|
|
|
+ SQLFactory prodclass = new SQLFactory(this, "经销商经营类目查询");
|
|
|
+ prodclass.addParameter("siteid", siteid);
|
|
|
+ prodclass.addParameter("tagentsid", tagentsid);
|
|
|
+ Rows prodclassrows = dbConnect.runSqlQuery(prodclass.getSQL());
|
|
|
+ row.put("prodclass", prodclassrows);
|
|
|
+ }
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
@@ -160,8 +171,22 @@ public class tagents extends Controller {
|
|
|
Iterator it = changemsgObject.keySet().iterator();
|
|
|
while (it.hasNext()) {
|
|
|
String key = (String) it.next();
|
|
|
- String value = changemsgObject.getString(key);
|
|
|
- tagents.setValue(key, value, 11L);
|
|
|
+ if ("saleprodclass".equals(key)) {
|
|
|
+ //经营类目修改
|
|
|
+ JSONArray saleprodclassArray = changemsgObject.getJSONArray("saleprodclass");
|
|
|
+ PaoSetRemote tagents_prodclassSet = tagents.getPaoSet("$tagents_prodclass", "tagents_prodclass", "tagentsid=" + tagentsid);
|
|
|
+ tagents_prodclassSet.deleteAll();
|
|
|
+ for (Object saleprodclassObject : saleprodclassArray) {
|
|
|
+ String fprodclassname = (String) saleprodclassObject;
|
|
|
+ PaoRemote saleprodclassPao = tagents_prodclassSet.addAtEnd();
|
|
|
+ saleprodclassPao.setValue("tagentsid", tagentsid, 11L);
|
|
|
+ saleprodclassPao.setValue("siteid", siteid, 11L);
|
|
|
+ saleprodclassPao.setValue("fprodclassname", fprodclassname, 11L);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String value = changemsgObject.getString(key);
|
|
|
+ tagents.setValue(key, value, 11L);
|
|
|
+ }
|
|
|
}
|
|
|
if (ftype.equals("商户认证")) {
|
|
|
tagents.setValue("ftype", "普通商户", 11L);
|