Commit bc7d6b42 by XiaHou

增加万科 从微V导入 功能

parent 5f5189a7
package com.macro.mall.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Author xh
* @Date 2021/4/14
* description:
*/
@Data
public class VankeGetUserInfoVO implements Serializable {
@ApiModelProperty(value = "轻应用id")
private String appid;
@ApiModelProperty(value = "云之家APP会传递ticket参数给轻应用(把ticket参数追加到轻应用对应的url中)时效为1小时,不建议开发者缓存使用")
private String ticket;
@ApiModelProperty(value = "轻应用secret,即appsecret")
private String secret;
@ApiModelProperty(value = "当前北京时间,Unix格式13位时间戳,精确到毫秒,3分钟内有效。")
private Long timestamp;
@ApiModelProperty(value = "授权级别:app")
private String scope;
}
......@@ -14,8 +14,8 @@ import java.util.Hashtable;
@Service
public class ADServiceImpl implements IADService {
private static String host = "182.61.50.234";//AD域IP,必须填写正确
private static String domain = "@tengfeikeji.club";//域名后缀,例.@noker.cn.com
private static String host = "10.0.1.1";//AD域IP,必须填写正确
private static String domain = "@vanke.net.cn";//域名后缀,例.@noker.cn.com
private static String port = "389"; //端口,一般默认389
......
package com.macro.mall.service.vanke.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.macro.mall.common.baiduyun.HttpUtil;
import com.macro.mall.common.utils.HttpClientUtil;
import com.macro.mall.common.utils.HttpUtils;
import com.macro.mall.common.utils.MyJsonUtil;
import com.macro.mall.dao.UmsMemberDao;
import com.macro.mall.domain.dto.VankeGetUserInfoVO;
import com.macro.mall.mapper.UmsMemberMapper;
import com.macro.mall.mapper.VankeDepartmentMapper;
import com.macro.mall.mapper.VankeVvUserMapper;
......@@ -64,17 +67,22 @@ public class VankeMemberLoginServiceImpl implements IVankeMemberLoginService {
//先判断redis是否存在vankeAccessToken
String vankeAccessToken = this.redisService.get("vankeAccessToken");
if(vankeAccessToken == null || vankeAccessToken.isEmpty()){
String params ="{\n" +
/*String params ="{\n" +
" \"appId\": \""+getConfig("appid")+"\",\n" +
" \"secret\": \""+getConfig("secret")+"\",\n" +
" \"timestamp\": "+new java.util.Date().getTime()+",\n" +
" \"scope\": \""+getConfig("scope")+"\"\n" +
"}";
"}";*/
String res = null;
Map<String,Object> map = new HashMap<>();
VankeGetUserInfoVO vankeGetUserInfoVO = new VankeGetUserInfoVO();
vankeGetUserInfoVO.setAppid(getConfig("appid"));
vankeGetUserInfoVO.setSecret(getConfig("secret"));
vankeGetUserInfoVO.setTimestamp(new java.util.Date().getTime());
vankeGetUserInfoVO.setScope(getConfig("scope"));
try {
res = HttpUtil.postGeneralUrl(getConfig("host")+"/gateway/oauth2/token/getAccessToken","application/json",params,"UTF-8");
System.out.println(getConfig("host"));
res = HttpUtil.postGeneralUrl(getConfig("host")+"/gateway/oauth2/token/getAccessToken","application/json",JSONObject.toJSONString(vankeGetUserInfoVO),"UTF-8");
map = MyJsonUtil.getMapChangeJson(res);
} catch (Exception e) {
e.printStackTrace();
......@@ -138,18 +146,25 @@ public class VankeMemberLoginServiceImpl implements IVankeMemberLoginService {
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg getVankeUserInfo(String ticket){
this.getVankeConfig();
if(ticket == null || "".equals(ticket)){
return new ResultMsg(false,"传入ticket为空");
}
//通过appId 和 ticket 以及 token发起获取用户身份信息请求
String params ="{\n" +
/*String params ="{\n" +
" \"appid\": \""+getConfig("appid")+"\",\n" +
" \"ticket\": \""+ticket+"\"\n" +
"}";
"}";*/
String res = null;
Map<String,Object> map = new HashMap<>();
VankeGetUserInfoVO vankeGetUserInfoVO = new VankeGetUserInfoVO();
vankeGetUserInfoVO.setAppid(getConfig("appid"));
vankeGetUserInfoVO.setTicket(ticket);
try {
res = HttpUtil.postGeneralUrl(getConfig("host")+"/gateway/ticket/user/acquirecontext?accessToken="+this.getVankeAccessToken(),"application/json",params,"UTF-8");
System.out.println(getConfig("host")+"/gateway/ticket/user/acquirecontext?accessToken="+this.getVankeAccessToken());
System.out.println(JSONObject.toJSONString(vankeGetUserInfoVO));
res = HttpUtil.postGeneralUrl(getConfig("host")+"/gateway/ticket/user/acquirecontext?accessToken="+this.getVankeAccessToken(),"application/json",JSONObject.toJSONString(vankeGetUserInfoVO),"UTF-8");
map = MyJsonUtil.getMapChangeJson(res);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -861,6 +861,9 @@
<if test="accouuntType != null">
and a.accouunt_type = #{accouuntType}
</if>
<if test="name != null and name != ''">
and a.name like CONCAT('%',#{name},'%')
</if>
</select>
<select id="selectUmsMemberByJobNo" parameterType="java.lang.String" resultMap="BaseResultMap">
......
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