privateString result;publicString getResult() {returnresult;
}public voidsetResult(String result) {this.result =result;
}/***
* AJAX for check MerchantAccount start
*
**/
privateString merchantAccount;publicString getMerchantAccount() {returnmerchantAccount;
}public voidsetMerchantAccount(String merchantAccount) {this.merchantAccount =merchantAccount;
}//AJAX for check Merchant
public String checkMerchantAccountMethod() throwsIOException {
AppResultJsonBean ajaxResultJsonBean= newAppResultJsonBean();if(StarCloudStringUtils.isEmpty(merchantAccount)) {
ajaxResultJsonBean.setIsOK(false);
ajaxResultJsonBean.setData(null);
ajaxResultJsonBean.setResultCode(-1);
ajaxResultJsonBean.setResultMessage("商家账号不能为空");
ajaxResultJsonBean.setOther(null);
JSONObject ajaxResultJsonData=JSONObject
.fromObject(ajaxResultJsonBean);this.result =ajaxResultJsonData.toString();returnSUCCESS;
}if (!StarCloudStringUtils.isMobile(merchantAccount)) {
ajaxResultJsonBean.setIsOK(false);
ajaxResultJsonBean.setData(null);
ajaxResultJsonBean.setResultCode(-2);
ajaxResultJsonBean.setResultMessage("商家账号格式不合法");
ajaxResultJsonBean.setOther(null);
JSONObject ajaxResultJsonData=JSONObject.fromObject(ajaxResultJsonBean);this.result =ajaxResultJsonData.toString();returnSUCCESS;
}
。。。MerchantBean checkMerchantBean=merchantIService.findMerchantByAccount(merchantAccount);if (checkMerchantBean != null) {
ajaxResultJsonBean.setIsOK(true);
ajaxResultJsonBean.setData(null);
ajaxResultJsonBean.setResultCode(0);
ajaxResultJsonBean.setResultMessage("商家账号可用");
ajaxResultJsonBean.setOther(null);
JSONObject ajaxResultJsonData=JSONObject.fromObject(ajaxResultJsonBean);this.result =ajaxResultJsonData.toString();returnSUCCESS;
}else{
ajaxResultJsonBean.setIsOK(false);
ajaxResultJsonBean.setData(null);
ajaxResultJsonBean.setResultCode(-3);
ajaxResultJsonBean.setResultMessage("商家账号不存在");
ajaxResultJsonBean.setOther(null);
JSONObject ajaxResultJsonData=JSONObject.fromObject(ajaxResultJsonBean);this.result =ajaxResultJsonData.toString();returnSUCCESS;
}
}/***
* AJAX for check MerchantAccount start end
*
**/