|
|
@@ -277,7 +277,6 @@ public class teammsg extends Controller {
|
|
|
* @return
|
|
|
*/
|
|
|
public String checkEntryTeamApply() throws P2Exception {
|
|
|
-
|
|
|
boolean isPass = content.getBooleanValue("isPass");
|
|
|
//加入商户团队申请表id
|
|
|
long tagentteamapplyid = content.getLong("tagentteamapplyid");
|
|
|
@@ -290,6 +289,7 @@ public class teammsg extends Controller {
|
|
|
if (paoSetRemote_tenterprise.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("未找到申请人信息").toString();
|
|
|
}
|
|
|
+ long oldtagentsid = paoSetRemote_tenterprise.getPao(0).getLong("tagentsid");
|
|
|
PaoRemote paoRemote_tenterprise = paoSetRemote_tenterprise.getPao(0);
|
|
|
//拒绝,只更新商户团队申请表
|
|
|
if (!isPass) {
|
|
|
@@ -299,18 +299,8 @@ public class teammsg extends Controller {
|
|
|
return getSucReturnObject().setData("拒绝成功").toString();
|
|
|
} else {
|
|
|
paoRemote.setValue("fstatus", "审核", 11L);
|
|
|
- String sql = "SELECT ftype FROM tagents WHERE tagentsid = '" + paoRemote_tenterprise.getString("tagentsid") + "'";
|
|
|
- Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
- String ftype = "";
|
|
|
- if (!rows.isEmpty()) {
|
|
|
- ftype = rows.get(0).getString("ftype");
|
|
|
- }
|
|
|
- //如果是个人
|
|
|
- if (ftype.equals("个人")) {
|
|
|
- paoRemote_tenterprise.getPaoSet("tagents", "tagents", "tagentsid=:tagentsid").getPao(0).delete();
|
|
|
- paoRemote_tenterprise.setValue("tagentsid", tagentsid, 11L);
|
|
|
- paoRemote_tenterprise.setValue("fisadministrator", false, 11L);
|
|
|
- } else {
|
|
|
+ boolean fissaveagentmsg = paoRemote.getBoolean("fissaveagentmsg");//是否保留当前商户信息
|
|
|
+ if (fissaveagentmsg) {
|
|
|
PaoRemote pao = paoSetRemote_tenterprise.addAtEnd();
|
|
|
pao.setValue("SITEID", paoRemote_tenterprise.getString("SITEID"), 11L);
|
|
|
pao.setValue("FNAME", paoRemote_tenterprise.getString("FNAME"), 11L);
|
|
|
@@ -320,13 +310,20 @@ public class teammsg extends Controller {
|
|
|
pao.setValue("tagentsid", tagentsid, 11L);
|
|
|
paoRemote.setValue("fuserid", pao.getUniqueIDValue(), 11L);
|
|
|
tenterprise_userid = pao.getUniqueIDValue();
|
|
|
+ } else {
|
|
|
+ paoRemote_tenterprise.setValue("tagentsid", tagentsid, 11L);
|
|
|
+ paoRemote_tenterprise.setValue("fisadministrator", false, 11L);
|
|
|
}
|
|
|
-
|
|
|
paoSetRemote.save();
|
|
|
+ if (!fissaveagentmsg) {
|
|
|
+ SQLFactory deleteagentsql = new SQLFactory(this, "商户档案删除");
|
|
|
+ deleteagentsql.addParameter("siteid", siteid);
|
|
|
+ deleteagentsql.addParameter("tagentsid", oldtagentsid);
|
|
|
+ dbConnect.runSqlUpdate(deleteagentsql.getSQL());
|
|
|
+ }
|
|
|
createSystemMessage("团队", "团队加入通知", "恭喜加入" + getAgent(tagentsid).getString("fbrand"), tenterprise_userid);
|
|
|
return getSucReturnObject().setData("审核成功").toString();
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
return getErrReturnObject().setErrMsg("未找到申请记录").toString();
|
|
|
}
|