Commit 9df00ac7 by 唐功亮

【新增】 个人中心三个跳转

parent c131b13d
...@@ -45,11 +45,11 @@ public class LogLoginController { ...@@ -45,11 +45,11 @@ public class LogLoginController {
@Login @Login
// @RequiresPermissions("manage:member:list") // @RequiresPermissions("manage:member:list")
public R login(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){ public R login(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
/* DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString()); DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString());
boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha()); boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha());
if(!captcha){ if(!captcha){
return R.error("验证码不正确"); return R.error("验证码不正确");
}*/ }
return R.ok().put("data",logLoginService.login(params,request,response)); return R.ok().put("data",logLoginService.login(params,request,response));
} }
......
...@@ -118,11 +118,15 @@ public class TycpdmFirmController extends AbstractController { ...@@ -118,11 +118,15 @@ public class TycpdmFirmController extends AbstractController {
public static void main(String[] args) throws InvocationTargetException, IllegalAccessException { public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {
/* String s = MD5Util.md5Encrypt32Upper("123123"); /* String s = MD5Util.md5Encrypt32Upper("GS1_20201013");
System.out.println(s);*/ System.out.println(s);*/
String userName_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("13515718321".getBytes(),"loginkey".getBytes())); String pass="GS1_20201013";
String pass_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("718321".getBytes(),"loginkey".getBytes())); String pass_MD5 = MD5Util.md5Encrypt32Lower(pass);
System.out.println(userName_M); System.out.println("pass_MD5 "+pass_MD5);
// String userName_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("1165004".getBytes(),"loginkey".getBytes()));
String pass_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass_MD5.getBytes(),"appsGdsn".getBytes()));
// System.out.println(userName_M);
System.out.println(pass_M); System.out.println(pass_M);
} }
/** /**
...@@ -269,9 +273,14 @@ public class TycpdmFirmController extends AbstractController { ...@@ -269,9 +273,14 @@ public class TycpdmFirmController extends AbstractController {
* 跳转GDS页面 * 跳转GDS页面
*/ */
@RequestMapping("/authApi/redirectGDS") @RequestMapping("/authApi/redirectGDS")
public R redirectGDS(HttpServletResponse response){ public R redirectGDS(@RequestBody Map<String, Object> params){
MemberEntity memberUser = getMemberUser(); //由于member表中没有手机用户的信息 通过memberDao获取
String url= tycpdmFirmService.redirectGDSURL(memberUser); Object id = params.get("id");
MemberEntity memberEntity=null;
if (id!=null){
memberEntity = memberDao.selectById(id.toString());
}
String url= tycpdmFirmService.redirectGDSURL(memberEntity,params);
try { try {
//response.sendRedirect(url); //response.sendRedirect(url);
return R.ok().put("data",url); return R.ok().put("data",url);
...@@ -299,4 +308,22 @@ public class TycpdmFirmController extends AbstractController { ...@@ -299,4 +308,22 @@ public class TycpdmFirmController extends AbstractController {
} }
/**
* 跳转业务大厅页面
*/
@RequestMapping("/authApi/redirectBusinessHall")
public R redirectBusinessHall(@RequestBody Map<String, Object> params){
//由于member表中没有手机用户的信息 通过memberDao获取
Object id = params.get("id");
MemberEntity memberEntity = memberDao.selectById(id.toString());
String url= tycpdmFirmService.redirectBusinessHall(params,memberEntity);
try {
//response.sendRedirect(url);
return R.ok().put("data",url);
} catch (Exception e) {
e.printStackTrace();
return R.error("跳转失败");
}
}
} }
...@@ -48,9 +48,10 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> { ...@@ -48,9 +48,10 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
void updateSystem(Map<String, Object> params); void updateSystem(Map<String, Object> params);
String redirectGDSURL(MemberEntity memberUser); String redirectGDSURL(MemberEntity memberUser,Map<String, Object> params);
String redirectGDSGLN(MemberEntity memberUser); String redirectGDSGLN(MemberEntity memberUser);
String redirectBusinessHall(Map map,MemberEntity memberUser);
} }
...@@ -74,7 +74,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity ...@@ -74,7 +74,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
Integer isQY=2; //是否开通企业认证 1.开通 2.未开通 Integer isQY=2; //是否开通企业认证 1.开通 2.未开通
Integer isXT=2; //是否是业务大厅系统成员 1.是 2.否 Integer isXT=2; //是否是业务大厅系统成员 1.是 2.否
Integer id=0; //用户ID Integer id=-99; //用户ID
String search="ws2";// 用户来源 manager:业务大厅手机号用户 ws2:member表用户 String search="ws2";// 用户来源 manager:业务大厅手机号用户 ws2:member表用户
String carno=null;// 条码卡号 String carno=null;// 条码卡号
String phone=null;//手机号码 String phone=null;//手机号码
...@@ -98,10 +98,11 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity ...@@ -98,10 +98,11 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
//登录成功 //登录成功
search="manager"; search="manager";
phone=userName; phone=userName;
//TODO tgl 需要中国编码官网提供 条码卡数据 来判断是否是系统用户 //需要中国编码官网提供 条码卡数据 来判断是否是系统用户
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
if (data!=null){ if (data!=null){
carno = data.getString("gdsCode"); carno = data.getString("gdsCode");
isXT=1;
} }
} }
} }
......
...@@ -11,6 +11,7 @@ import io.office.modules.manage.entity.*; ...@@ -11,6 +11,7 @@ import io.office.modules.manage.entity.*;
import io.office.modules.manage.service.TycpdmFirmChangeService; import io.office.modules.manage.service.TycpdmFirmChangeService;
import io.office.modules.manage.utils.DESUtils; import io.office.modules.manage.utils.DESUtils;
import io.office.modules.manage.utils.DateUtils; import io.office.modules.manage.utils.DateUtils;
import io.office.modules.manage.utils.MD5Util;
import org.apache.commons.beanutils.BeanMap; import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -448,34 +449,46 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -448,34 +449,46 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
} }
@Override @Override
public String redirectGDSURL(MemberEntity memberUser) { public String redirectGDSURL(MemberEntity memberUser,Map<String, Object> params) {
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer userType = Integer.valueOf(String.valueOf(params.get("userType")));
Integer levels=null;//用户权限 空.代表普通用户 0.代表中心管理员,1.代表校验管理员 其他4位.代表分中心管理员 Integer levels=null;//用户权限 空.代表普通用户 0.代表中心管理员,1.代表校验管理员 其他4位.代表分中心管理员
int dept = -2; //0表示中心管理员;-2表示普通成员。-100表示没有任何值时 int dept = -2; //0表示中心管理员;-2表示普通成员。-100表示没有任何值时
String regist_or_login_from_ancc=""; String regist_or_login_from_ancc="";
String username = memberUser.getUsername(); String username = null;
String pass = memberUser.getPass(); String pass =null;
if (matchPhoneNumber(username)){ if (memberUser!=null){
//TODO tgl 手机号用户 调用接口获取 条码数据 username=memberUser.getUsername();
pass = memberUser.getPass();
}
if (userType==1){
//手机号用户获取 条码卡号
Integer carno = Integer.valueOf(String.valueOf(params.get("carno")));
username=carno+"";
MemberEntity memberEntity = memberDao.selectByName(carno+"");
//获取密码MD5加密后的密码
String pass_MD5 = memberEntity.getPass();
//再进行 DES加密
pass = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass_MD5.getBytes(),"appsGdsn".getBytes()));
}else {//其他用户 }else {//其他用户
//密码进行 DES加密 //密码进行 DES加密
//String pass_DES = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass.getBytes(),DESUtils.Key.getBytes())); //String pass_DES = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass.getBytes(),DESUtils.Key.getBytes()));
levels=memberDao.selectCode_agen(username); levels=memberDao.selectCode_agen(username);
if (levels==null){ if (levels==null){
dept=-2; dept=-2;
}else if (levels==0){ }else if (levels==0){
dept=0; dept=0;
} }
pass = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass.getBytes(),"appsGdsn".getBytes()));
}
regist_or_login_from_ancc=dept+"{regist_or_login_from_ancc}"; regist_or_login_from_ancc=dept+"{regist_or_login_from_ancc}";
regist_or_login_from_ancc=DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(regist_or_login_from_ancc.getBytes(),DESUtils.Key.getBytes())); regist_or_login_from_ancc= MD5Util.md5Encrypt32Lower(regist_or_login_from_ancc);
String url="http://v3.gds.org.cn/registerOrLoginFromAncc.aspx?uname="+username+"&pwd="+pass+"&regist_or_login_from_ancc="+regist_or_login_from_ancc+"&dept="+dept; String url="http://v3.gds.org.cn/registerOrLoginFromAncc.aspx?uname="+username+"&pwd="+pass+"&regist_or_login_from_ancc="+regist_or_login_from_ancc+"&dept="+dept;
return url; return url;
} }
return null;
}
/** /**
* 只有官网注册用户登录,已通过厂商实名认证的,此处直接跳转,传参为用户名和密码 * 只有官网注册用户登录,已通过厂商实名认证的,此处直接跳转,传参为用户名和密码
* username 参数 进行DES加密 * username 参数 进行DES加密
...@@ -492,6 +505,32 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -492,6 +505,32 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
return url; return url;
} }
@Override
public String redirectBusinessHall(Map map,MemberEntity memberUser) {
String phone="";
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer userType = Integer.valueOf(String.valueOf(map.get("userType")));
if (userType==1){
phone=memberUser.getUsername();//手机号
}else if (userType==2){
//调用另一个接口
phone=memberUser.getUsername();//条码卡号
String phone_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(phone.getBytes(),"loginkey".getBytes()));
String password = memberUser.getPassword();//名文密码
String password_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(password.getBytes(),"loginkey".getBytes()));
String url="http://wsdt.gs1cn.org/anccoh/login?method=gdsLoginSSO&gdsCode="+phone_M+"&password="+password_M;
return url;
}else if (userType==3){
phone=memberUser.getPhone();//手机号
}else {
throw new RRException("用户类型错误");
}
String phone_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(phone.getBytes(),"loginkey".getBytes()));
String url="http://wsdt.gs1cn.org/anccoh/login?method=phoneSSO&phone="+phone_M;
return url;
}
/** /**
* 验证手机号 由于号码段不断的更新,只需要判断手机号有11位,并且全是数字以及1开头等 * 验证手机号 由于号码段不断的更新,只需要判断手机号有11位,并且全是数字以及1开头等
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment