|
|
@@ -106,15 +106,19 @@ public class NetEasyService {
|
|
|
}
|
|
|
logger.info("邮箱无此账号,创建邮箱账号:{}",employee.toString());
|
|
|
QiyeOpenPlatSDK instanceSDK = netEasySDK.getSDKInstance();
|
|
|
+ String initAccount = PinyinUtils.getCustomPinyin(employee.getEm_name());
|
|
|
Q q = Q.init(null)
|
|
|
.addParam("domain", netEasyConfig.getDomain())
|
|
|
- .addParam("accountName", PinyinUtils.getCustomPinyin(employee.getEm_name()))
|
|
|
+ .addParam("accountName", initAccount)
|
|
|
.addParam("name", employee.getEm_name())
|
|
|
.addParam("job", employee.getEm_position())
|
|
|
.addParam("jobNumber", employee.getEm_code())
|
|
|
.addParam("unitId", employee.getOrneteasyid());
|
|
|
- if(employee.getEm_password().length() >=8 && hasThreeCharacterTypes(employee.getEm_password())){
|
|
|
- q.addParam("password", employee.getEm_password());
|
|
|
+ String initPWD = employee.getEm_password();
|
|
|
+ if(! StringUtil.hasText(initPWD) || initPWD.length() <8 || ! hasThreeCharacterTypes(initPWD)){
|
|
|
+ //初始密码拼音+系统账号+SI
|
|
|
+ initPWD = initAccount+employee.getEm_code()+"SI";
|
|
|
+ q.addParam("password", PinyinUtils.getCustomPinyin(employee.getEm_name())+employee.getEm_code()+"SI");
|
|
|
}
|
|
|
if(StringUtil.hasText(employee.getEm_mobile())){
|
|
|
q.addParam("mobile", employee.getEm_mobile());
|
|
|
@@ -124,6 +128,13 @@ public class NetEasyService {
|
|
|
if(ResultEnum.SUCCESS.getCode() == r.getCode()){
|
|
|
AccountResp accountResp = (AccountResp) r.getDataBean(AccountResp.class);
|
|
|
baseDao.updateByCondition("employee","em_neteasyid='"+accountResp.getAccountName()+"'","em_code='"+employee.getEm_code()+"'");
|
|
|
+ baseDao.execute("insert into UAPPROVALMSG(ID_,TYPE_,TITLE_,MSG_,EMS_) " +
|
|
|
+ "select UAPPROVALMSG_SEQ.NEXTVAL,'TEXT','邮箱开通提醒','"+employee.getEm_name()+" 您的企业邮箱账号已创建\n" +
|
|
|
+ "账号:"+initAccount+"@sisemi.com.cn\n" +
|
|
|
+ "初始密码:"+initPWD+"\n" +
|
|
|
+ "登录地址:https://mail.sisemi.com.cn/\n" +
|
|
|
+ "您也可以通过UAS系统首页-->右上角 网易邮箱 进行SSO免密登录。',em_qywx" +
|
|
|
+ " from employee where em_code='"+employee.getEm_code()+"' and em_qywx is not null");
|
|
|
logger.info("创建账号成功,账号名称:{}",employee.getEm_name());
|
|
|
}
|
|
|
}
|
|
|
@@ -453,7 +464,7 @@ public class NetEasyService {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- private boolean hasThreeCharacterTypes(String password) {
|
|
|
+ public boolean hasThreeCharacterTypes(String password) {
|
|
|
int typeCount = 0;
|
|
|
// 检查是否包含大写字母
|
|
|
if (password.matches(".*[A-Z].*")) typeCount++;
|