供应商注册,去掉短信开头地产俩字

This commit is contained in:
ptt 2025-07-03 16:57:40 +08:00
parent 2dc2fa4fb4
commit 26450f80d0
1 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,58 @@
package shkd.repc.resp.formplugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.resource.ResManager;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.ext.form.control.CountDown;
import kd.bos.message.api.ShortMessageInfo;
import kd.repc.resp.formplugin.portal.ResetPasswordEdit;
import kd.repc.resp.formplugin.registered.RegisteredUtils;
import kd.repc.resp.formplugin.registered.SupplierRegisteredEdit;
import java.security.SecureRandom;
import java.util.Collections;
import java.util.Date;
public class SupplierRegisteredEditNew extends SupplierRegisteredEdit {
@Override
protected boolean bdoBsCode(DynamicObject dataEntity) {
boolean isImageVerify = this.verifyImageVerify();
if (!isImageVerify) {
return false;
} else {
boolean isOkPhone = this.verifyMobilePhone();
if (!isOkPhone) {
return false;
} else {
boolean isOkNextSend = this.verifyDateTime();
if (!isOkNextSend) {
return false;
} else {
String mobilePhone = dataEntity.getString("bs_mobilephone");
this.getView().setVisible(Boolean.FALSE, new String[]{"btn_code"});
this.getView().setVisible(Boolean.TRUE, new String[]{"countdownap"});
CountDown down = (CountDown)this.getView().getControl("countdownap");
down.setDuration(120);
int code = (new SecureRandom()).nextInt(900000) + 100000;
if (RegisteredUtils.isCodeEnable()) {
code = 123456;
this.getPageCache().put("bs_code", String.valueOf(code));
this.getModel().setValue("bs_code", String.valueOf(code));
} else {
String companyName = (String)this.getView().getFormShowParameter().getCustomParam("companyname");
ShortMessageInfo messageInfo = new ShortMessageInfo();
messageInfo.setPhone(Collections.singletonList(mobilePhone.replace("+86-", "")));
String str = String.format(ResManager.loadKDString("验证码%1$s您正在注册%2$s的供应商用户感谢您的支持", "SupplierRegisteredEdit_4", "repc-resp-formplugin", new Object[0]), code, StringUtils.isEmpty(companyName) ? "" : companyName);
messageInfo.setMessage(str);
(new ResetPasswordEdit()).sendShort(messageInfo);
}
this.getPageCache().put("bs_code", String.valueOf(code));
this.getPageCache().put("countdownap", String.valueOf((new Date()).getTime()));
return false;
}
}
}
}
}