|
|
@@ -92,9 +92,17 @@ public class YongHService {
|
|
|
Map<String,Object> xmlData = new HashMap<>();
|
|
|
Map<String,Object> info = new HashMap<>();
|
|
|
Map<String,Object> user = new HashMap<>();
|
|
|
- String name=PinyinUtils.getCustomPinyin(employee.getEm_name());
|
|
|
+ String name = PinyinUtils.getCustomPinyin(employee.getEm_name());
|
|
|
+ if(StringUtil.hasText(employee.getEm_yonghongid())){
|
|
|
+ name=employee.getEm_yonghongid();
|
|
|
+ }
|
|
|
user.put("name",name);
|
|
|
- user.put("pass",employee.getEm_password());
|
|
|
+ String initPWD = employee.getEm_password();
|
|
|
+ if(! StringUtil.hasText(initPWD) || initPWD.length() <8 || ! hasThreeCharacterTypes(initPWD)){
|
|
|
+ //初始密码拼音+系统账号+SI
|
|
|
+ initPWD = name+employee.getEm_code()+"SI";
|
|
|
+ }
|
|
|
+ user.put("pass",initPWD);
|
|
|
user.put("email",employee.getEm_email());
|
|
|
user.put("alias",employee.getEm_name());
|
|
|
user.put("parent","");
|
|
|
@@ -110,7 +118,14 @@ public class YongHService {
|
|
|
System.out.println(res);
|
|
|
YongHResp resp= FlexJsonUtil.fromJson(res, YongHResp.class);
|
|
|
if("1".equals(resp.getResults().getResult().getLevel())){
|
|
|
- baseDao.updateByCondition("employee","EM_YONGHONGID='"+name+"'","em_code='"+employee.getEm_code()+"'");
|
|
|
+ baseDao.updateByCondition("employee","EM_YONGHONGID='"+name+"',em_yonghongsynced=-1","em_code='"+employee.getEm_code()+"'");
|
|
|
+ baseDao.execute("insert into UAPPROVALMSG(ID_,TYPE_,TITLE_,MSG_,EMS_) " +
|
|
|
+ "select UAPPROVALMSG_SEQ.NEXTVAL,'TEXT','永洪账号开通提醒','"+employee.getEm_name()+" 您的永洪报表平台账号已创建\n" +
|
|
|
+ "账号:"+name+
|
|
|
+ "初始密码:"+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");
|
|
|
return true;
|
|
|
}else{
|
|
|
logger.info("yonghong添加用户失败,token:{},message:{}",token,resp.getResults().getResult().getMessage());
|
|
|
@@ -164,6 +179,17 @@ public class YongHService {
|
|
|
}else{
|
|
|
logger.info("yonghong-logout-请求失败:{}",response.getResponseText());
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ public boolean hasThreeCharacterTypes(String password) {
|
|
|
+ int typeCount = 0;
|
|
|
+ // 检查是否包含大写字母
|
|
|
+ if (password.matches(".*[A-Z].*")) typeCount++;
|
|
|
+ // 检查是否包含小写字母
|
|
|
+ if (password.matches(".*[a-z].*")) typeCount++;
|
|
|
+ // 检查是否包含数字
|
|
|
+ if (password.matches(".*[0-9].*")) typeCount++;
|
|
|
+ // 检查是否包含特殊符号(非字母数字)
|
|
|
+ if (password.matches(".*[^A-Za-z0-9].*")) typeCount++;
|
|
|
+ return typeCount >= 3;
|
|
|
}
|
|
|
}
|