62,614
社区成员
发帖
与我相关
我的任务
分享
public void btnSendMessageActionListsener(){
String dstcNo = jtf_dstcNo.getText();
String phoneNum = jtf_phoneNo.getText();
if(dstcNo.equals("")||dstcNo == null||phoneNum.equals("")||phoneNum == null||phoneNum.length()!=11){
MsgBox.showError(baseMainPanel, "请将相关信息填写正确!");
}else{
times++;
checkCode = phoneinfolistAction.SetCheckCode();
System.out.println("手机号码:"+phoneNum);
System.out.println("序号:"+times);
System.out.println("校验码:"+checkCode);
MessageInfo messageInfo = new MessageInfo();
messageInfo.phoneNum = phoneNum;
messageInfo.times = Integer.toString(times);
messageInfo.checkCode = checkCode;
Map<String, Object> mapper = new HashMap<String, Object>();
mapper = phoneinfolistAction.SendMessage(messageInfo);
GlassPane.getInstance().hideMessage();
int nResult=(Integer)mapper.get("nResult");
if(nResult == 0)
{
//MsgBox.showError(baseMainPanel, "提交成功");
pan_checkcode.setVisible(true);
lab_time.setVisible(true);
//btn_sendmessage.setEnabled(false);
jtf_times.setText(Integer.toString(times));
// jtf_checkcode.setText(checkCode);
time = 180;
final Timer timer =new Timer();
timer.schedule(new TimerTask() {
public void run() {
time--;
lab_time.setText(time+"s后重新发送");
if(time <= 0){
timer.cancel();
lab_time.setVisible(false);
//btn_sendmessage.setEnabled(true);
}
}
}, 0, 1000);
}
else
{
String errMessage=(String)mapper.get("errMessage");
if(nResult > 0 && nResult < 12){
boolean bln = MsgBox.showYESNO(baseMainPanel, errMessage+"。是否继续操作?");
if(bln){
times = 0;
btnSubmitActionListsener();
}
}else{
times = 0;
MsgBox.showError(baseMainPanel, errMessage);
}
}
}
}