|
|
@@ -164,20 +164,24 @@ public class teammsg extends Controller {
|
|
|
*/
|
|
|
public String checkEntryTeamApply() throws P2Exception {
|
|
|
|
|
|
- String isPass = content.getString("isPass");
|
|
|
+ boolean isPass = content.getBooleanValue("isPass");
|
|
|
//加入商户团队申请表id
|
|
|
- String tagentteamapplyid = content.getString("tagentteamapplyid");
|
|
|
+ long tagentteamapplyid = content.getLong("tagentteamapplyid");
|
|
|
//企业账号表id
|
|
|
- String tenterprise_userid = content.getString("tenterprise_userid");
|
|
|
+ long tenterprise_userid = content.getLong("tenterprise_userid");
|
|
|
PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tagentteamapply", "tagentteamapplyid = '" + tagentteamapplyid + "'");
|
|
|
if (!paoSetRemote.isEmpty()) {
|
|
|
PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
PaoSetRemote paoSetRemote_tenterprise = paoRemote.getPaoSet("tenterprise_users", "tenterprise_users", "tenterprise_userid = '" + tenterprise_userid + "'");
|
|
|
+ if (paoSetRemote_tenterprise.isEmpty()) {
|
|
|
+ return getErrReturnObject().setErrMsg("未找到申请人信息").toString();
|
|
|
+ }
|
|
|
PaoRemote paoRemote_tenterprise = paoSetRemote_tenterprise.getPao(0);
|
|
|
//拒绝,只更新商户团队申请表
|
|
|
- if (isPass.equals("0")) {
|
|
|
+ if (!isPass) {
|
|
|
paoRemote.setValue("fstatus", "拒绝", 11L);
|
|
|
paoSetRemote.save();
|
|
|
+ createSystemMessage("团队", "团队加入通知", "申请不通过!", tenterprise_userid);
|
|
|
return getSucReturnObject().setData("拒绝成功").toString();
|
|
|
} else {
|
|
|
paoRemote.setValue("fstatus", "审核", 11L);
|
|
|
@@ -191,23 +195,21 @@ public class teammsg extends Controller {
|
|
|
if (ftype.equals("个人")) {
|
|
|
paoRemote_tenterprise.getPaoSet("tagents", "tagents", "tagentsid=:tagentsid").getPao(0).delete();
|
|
|
paoRemote_tenterprise.setValue("tagentsid", tagentsid, 11L);
|
|
|
-
|
|
|
} else {
|
|
|
PaoRemote pao = paoSetRemote_tenterprise.addAtEnd();
|
|
|
- String newUserid = String.valueOf(getUniqueIDValue("tenterprise_users", "tenterprise_userid"));
|
|
|
pao.setValue("SITEID", paoRemote_tenterprise.getString("SITEID"), 11L);
|
|
|
pao.setValue("FNAME", paoRemote_tenterprise.getString("FNAME"), 11L);
|
|
|
pao.setValue("FPHONENUMBER", paoRemote_tenterprise.getString("FPHONENUMBER"), 11L);
|
|
|
- pao.setValue("tenterprise_userid", newUserid, 11L);
|
|
|
pao.setValue("fusertype", "经销商");
|
|
|
pao.setValue("fisadministrator", 0, 11L);
|
|
|
pao.setValue("tagentsid", tagentsid, 11L);
|
|
|
- //
|
|
|
- paoRemote.setValue("fuserid", newUserid, 11L);
|
|
|
-
|
|
|
+ paoRemote.setValue("fuserid", pao.getUniqueIDValue(), 11L);
|
|
|
+ tenterprise_userid = pao.getUniqueIDValue();
|
|
|
}
|
|
|
|
|
|
paoSetRemote.save();
|
|
|
+ System.err.println(tagentsid);
|
|
|
+ createSystemMessage("团队", "团队加入通知", "恭喜加入" + getAgent(tagentsid).getString("fbrand"), tenterprise_userid);
|
|
|
return getSucReturnObject().setData("审核成功").toString();
|
|
|
}
|
|
|
|