From 26450f80d0b9f0a0b7f6137f0cf1383a4156b5e4 Mon Sep 17 00:00:00 2001 From: ptt <2403326863@qq.com> Date: Thu, 3 Jul 2025 16:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E7=9F=AD=E4=BF=A1=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=E5=9C=B0=E4=BA=A7=E4=BF=A9=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formplugin/SupplierRegisteredEditNew.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 main/java/shkd/repc/resp/formplugin/SupplierRegisteredEditNew.java diff --git a/main/java/shkd/repc/resp/formplugin/SupplierRegisteredEditNew.java b/main/java/shkd/repc/resp/formplugin/SupplierRegisteredEditNew.java new file mode 100644 index 0000000..be75554 --- /dev/null +++ b/main/java/shkd/repc/resp/formplugin/SupplierRegisteredEditNew.java @@ -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; + } + } + } + } +}