|
|
@@ -4,10 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.cnd3b.common.Controller;
|
|
|
import com.cnd3b.common.data.Rows;
|
|
|
import com.cnd3b.common.data.SQLFactory;
|
|
|
-import com.cnd3b.utility.wechatdock.WechatDock_Enterprise;
|
|
|
-import p2.pao.PaoRemote;
|
|
|
-import p2.pao.PaoSetRemote;
|
|
|
-import p2.util.P2Exception;
|
|
|
|
|
|
public class tagents extends Controller {
|
|
|
/**
|
|
|
@@ -21,139 +17,13 @@ public class tagents extends Controller {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 新增下游企业(经销商档案)
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- public String insertTagents() throws P2Exception {
|
|
|
- //经销商编号
|
|
|
- String fagentnum = content.getString("fagentnum");
|
|
|
- //经销商名称
|
|
|
- String fagentname = content.getString("fagentname");
|
|
|
- //联系人
|
|
|
- String fcontact = content.getString("fcontact");
|
|
|
- //联系方式
|
|
|
- String fphonenumber = content.getString("fphonenumber");
|
|
|
- //省
|
|
|
- String fprovince = content.getString("fprovince");
|
|
|
- //市
|
|
|
- String fcity = content.getString("fcity");
|
|
|
- //县
|
|
|
- String fcounty = content.getString("fcounty");
|
|
|
- //地址
|
|
|
- String faddress = content.getString("faddress");
|
|
|
- //所属业务员ID
|
|
|
- String tsalerid = content.getString("tsalerid");
|
|
|
- //下游企业corpid
|
|
|
- String wechat_corpid = content.getString("wechat_corpid");
|
|
|
- //下游企业名称
|
|
|
- String wechat_corp_name = content.getString("wechat_corp_name");
|
|
|
- //下游企业应用id
|
|
|
- String wechat_agentid = content.getString("wechat_agentid");
|
|
|
-
|
|
|
- PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tagents");
|
|
|
- PaoRemote paoRemote = paoSetRemote.addAtEnd();
|
|
|
- paoRemote.setValue("fagentnum", fagentnum, 11L);
|
|
|
- paoRemote.setValue("fagentname", fagentname, 11L);
|
|
|
- paoRemote.setValue("fcontact", fcontact, 11L);
|
|
|
- paoRemote.setValue("fphonenumber", fphonenumber, 11L);
|
|
|
- paoRemote.setValue("fprovince", fprovince, 11L);
|
|
|
- paoRemote.setValue("fcity", fcity, 11L);
|
|
|
- paoRemote.setValue("fcounty", fcounty, 11L);
|
|
|
- paoRemote.setValue("faddress", faddress, 11L);
|
|
|
- paoRemote.setValue("tsalerid", tsalerid, 11L);
|
|
|
- paoRemote.setValue("siteid", "JIUSHENG");
|
|
|
- paoRemote.setValue("createby", username, 11L);
|
|
|
- paoRemote.setValue("wechat_corpid", wechat_corpid, 11L);
|
|
|
- paoRemote.setValue("wechat_corp_name", wechat_corp_name, 11L);
|
|
|
- paoRemote.setValue("wechat_agentid", wechat_agentid, 11L);
|
|
|
- paoSetRemote.save();
|
|
|
-
|
|
|
- return getSucReturnObject().toString();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新下游企业(经销商档案)
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- public String updateTagents() throws P2Exception {
|
|
|
- String tagentsid = content.getString("tagentsid");
|
|
|
- //经销商编号
|
|
|
- String fagentnum = content.getString("fagentnum");
|
|
|
- //经销商名称
|
|
|
- String fagentname = content.getString("fagentname");
|
|
|
- //联系人
|
|
|
- String fcontact = content.getString("fcontact");
|
|
|
- //联系方式
|
|
|
- String fphonenumber = content.getString("fphonenumber");
|
|
|
- //省
|
|
|
- String fprovince = content.getString("fprovince");
|
|
|
- //市
|
|
|
- String fcity = content.getString("fcity");
|
|
|
- //县
|
|
|
- String fcounty = content.getString("fcounty");
|
|
|
- //地址
|
|
|
- String faddress = content.getString("faddress");
|
|
|
- //所属业务员ID
|
|
|
- String tsalerid = content.getString("tsalerid");
|
|
|
- //下游企业corpid
|
|
|
- String wechat_corpid = content.getString("wechat_corpid");
|
|
|
- //下游企业名称
|
|
|
- String wechat_corp_name = content.getString("wechat_corp_name");
|
|
|
- //下游企业应用id
|
|
|
- String wechat_agentid = content.getString("wechat_agentid");
|
|
|
-
|
|
|
- PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tagents", "tagentsid = '" + tagentsid + "'");
|
|
|
- if (!paoSetRemote.isEmpty()) {
|
|
|
- PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
- paoRemote.setValue("fagentnum", fagentnum, 11L);
|
|
|
- paoRemote.setValue("fagentname", fagentname, 11L);
|
|
|
- paoRemote.setValue("fcontact", fcontact, 11L);
|
|
|
- paoRemote.setValue("fphonenumber", fphonenumber, 11L);
|
|
|
- paoRemote.setValue("fprovince", fprovince, 11L);
|
|
|
- paoRemote.setValue("fcity", fcity, 11L);
|
|
|
- paoRemote.setValue("fcounty", fcounty, 11L);
|
|
|
- paoRemote.setValue("faddress", faddress, 11L);
|
|
|
- paoRemote.setValue("tsalerid", tsalerid, 11L);
|
|
|
- paoRemote.setValue("siteid", "JIUSHENG");
|
|
|
- paoRemote.setValue("createby", username, 11L);
|
|
|
- paoRemote.setValue("wechat_corpid", wechat_corpid, 11L);
|
|
|
- paoRemote.setValue("wechat_corp_name", wechat_corp_name, 11L);
|
|
|
- paoRemote.setValue("wechat_agentid", wechat_agentid, 11L);
|
|
|
- paoSetRemote.save();
|
|
|
- }
|
|
|
- return getSucReturnObject().toString();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除下游企业(经销商档案)
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- public String deleteTagents() throws P2Exception {
|
|
|
- String tagentsid = content.getString("tagentsid");
|
|
|
- if (tagentsid == null || tagentsid.equals("")) {
|
|
|
- return getErrReturnObject().setErrMsg("经销商id为空").toString();
|
|
|
- }
|
|
|
- PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tagents", "tagentsid = '" + tagentsid + "'");
|
|
|
- if (!paoSetRemote.isEmpty()) {
|
|
|
- PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
- paoRemote.delete();
|
|
|
- paoSetRemote.save();
|
|
|
- }
|
|
|
- return getSucReturnObject().toString();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询下游企业(经销商档案)列表
|
|
|
+ * 查询经销商列表
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public String selectTagentsList() {
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "经销商档案列表");
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
|
|
|
return getSucReturnObject().setData(rows).toString();
|