|
|
@@ -4,14 +4,12 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyuncs.exceptions.ClientException;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.xiaoleilu.hutool.crypto.SecureUtil;
|
|
|
-import com.xiaoleilu.hutool.http.HttpUtil;
|
|
|
import com.xiaoleilu.hutool.util.StrUtil;
|
|
|
import io.jsonwebtoken.Claims;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.authc.*;
|
|
|
import org.apache.shiro.authc.pam.UnsupportedTokenException;
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
-import org.omg.CORBA.INTERNAL;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.HashOperations;
|
|
|
@@ -29,6 +27,7 @@ import platform.config.redis.RedisService;
|
|
|
import platform.modules.api.dto.SyncUserDto;
|
|
|
import platform.modules.api.response.epoint.EpointTokenDto;
|
|
|
import platform.modules.api.service.SkyImageApiService;
|
|
|
+import platform.modules.api.service.SyncThridFacade;
|
|
|
import platform.modules.build.entity.Company;
|
|
|
import platform.modules.build.entity.CompanyContact;
|
|
|
import platform.modules.build.entity.CompanyMaterial;
|
|
|
@@ -121,6 +120,9 @@ public class HomeRefactorController extends BaseController {
|
|
|
@Autowired
|
|
|
private SkyImageApiService skyImageApiService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SyncThridFacade syncThridFacade;
|
|
|
+
|
|
|
@Autowired
|
|
|
CompanyInfoManageService companyInfoManageService;
|
|
|
|
|
|
@@ -520,7 +522,6 @@ public class HomeRefactorController extends BaseController {
|
|
|
|
|
|
Street finalStreet = street;
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
- //同步信息天启
|
|
|
SyncUserDto dto = new SyncUserDto();
|
|
|
dto.setAction(Constant.METHOD_STATUS.INSERT);
|
|
|
dto.setOldUserName("");
|
|
|
@@ -532,23 +533,8 @@ public class HomeRefactorController extends BaseController {
|
|
|
dto.setStreetName(finalStreet.getName());
|
|
|
}
|
|
|
dto.setToken(skyImageApiService.accessToken());
|
|
|
- skyImageApiService.syncUserInfo(dto);
|
|
|
+ syncThridFacade.syncUser(dto, null);
|
|
|
}, ThreadPoolUtil.getInstance());
|
|
|
- /*new Thread(() -> {
|
|
|
- //同步信息天启
|
|
|
- SyncUserDto dto = new SyncUserDto();
|
|
|
- dto.setAction(Constant.METHOD_STATUS.INSERT);
|
|
|
- dto.setOldUserName("");
|
|
|
- dto.setUserName(user.getUser_name());
|
|
|
- dto.setUserLoginName(user.getNick_name());
|
|
|
- dto.setPassword(information.getPassword().trim());
|
|
|
- dto.setCompanyName(information.getCompany_name());
|
|
|
- if (null != information.getStreet_id()) {
|
|
|
- dto.setStreetName(finalStreet.getName());
|
|
|
- }
|
|
|
- dto.setToken(skyImageApiService.accessToken());
|
|
|
- skyImageApiService.syncUserInfo(dto);
|
|
|
- }, "syncUserInfo").start();*/
|
|
|
|
|
|
//发送短信
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
@@ -597,17 +583,6 @@ public class HomeRefactorController extends BaseController {
|
|
|
dto.setToken(skyImageApiService.accessToken());
|
|
|
skyImageApiService.syncUserInfo(dto);
|
|
|
}, ThreadPoolUtil.getInstance());
|
|
|
- /*new Thread(() -> {
|
|
|
- // 同步密码到天启
|
|
|
- SyncUserDto dto = new SyncUserDto();
|
|
|
- dto.setAction(Constant.METHOD_STATUS.UPDATE);
|
|
|
- dto.setOldUserName(user.getNick_name());
|
|
|
- dto.setUserName(user.getUser_name());
|
|
|
- dto.setUserLoginName(user.getNick_name());
|
|
|
- dto.setPassword(information.getPassword());
|
|
|
- dto.setToken(skyImageApiService.accessToken());
|
|
|
- skyImageApiService.syncUserInfo(dto);
|
|
|
- }, "syncUserInfo").start();*/
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -616,6 +591,43 @@ public class HomeRefactorController extends BaseController {
|
|
|
return ResponseMessage.success("密码修改成功!系统将跳转到登陆页进行登录");
|
|
|
}
|
|
|
|
|
|
+ @Value("${jszypt.url.login}")
|
|
|
+ private String JszyptLoginUrl;
|
|
|
+
|
|
|
+ @OperationLog(value = "获取积分平台登录信息")
|
|
|
+ @GetMapping(value = "/jszyptLoginInfo")
|
|
|
+ @ResponseBody
|
|
|
+ public ResponseMessage getJszyptLoginInfo() {
|
|
|
+
|
|
|
+ User user = ShiroUtils.getUserEntity();
|
|
|
+ Map map = new HashMap();
|
|
|
+ //地址
|
|
|
+ map.put("url", JszyptLoginUrl);
|
|
|
+ //账号
|
|
|
+ map.put("userName ", user.getNick_name());
|
|
|
+ //联系电话
|
|
|
+ map.put("phone", user.getPhone());
|
|
|
+ //用户类型(1代表个人用户,2代表企业用户,3代表政府用户)
|
|
|
+ Integer userType = user.getUser_type();
|
|
|
+ if(Objects.equals(Constant.UserType.PERSONAL,userType)){
|
|
|
+ map.put("userType", 1);
|
|
|
+ }else if(Objects.equals(Constant.UserType.COMPANY,userType)){
|
|
|
+ map.put("userType", 2);
|
|
|
+ }else if(Objects.equals(Constant.UserType.GOVERNMENT,userType)){
|
|
|
+ map.put("userType", 3);
|
|
|
+ }
|
|
|
+ if(Objects.equals(Constant.UserType.COMPANY,userType)){
|
|
|
+ Company company = companyService.findById(user.getCompany_id());
|
|
|
+ if(company!=null){
|
|
|
+ //统一社会信用代码
|
|
|
+ map.put("paperNo", company.getUscc());
|
|
|
+ //公司名称
|
|
|
+ map.put("companyName", company.getCompany_name());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResponseMessage.success("获取积分平台登录信息", map);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 用户登陆
|
|
|
* 先根据用户名查询出一条用户记录再对比密码是否正确可以防止sql注入
|
|
|
@@ -692,12 +704,12 @@ public class HomeRefactorController extends BaseController {
|
|
|
//根据code拿到token
|
|
|
EpointTokenDto epointTokenDto = homeRefactorService.getTokenByCode(code);
|
|
|
String accessToken = epointTokenDto.getAccess_token();
|
|
|
- if(StrUtil.isBlank(accessToken)){
|
|
|
+ if (StrUtil.isBlank(accessToken)) {
|
|
|
return ResponseMessage.error(Constant.USER_CODE_INVALIAD);
|
|
|
}
|
|
|
//根据token与库里对比拿用户
|
|
|
User user = homeRefactorService.getCurrentLoginUser(accessToken);
|
|
|
- if (user!=null) {
|
|
|
+ if (user != null) {
|
|
|
String username = user.getNick_name();
|
|
|
//获取当前的Subject
|
|
|
Subject currentUser = ShiroUtils.getSubject();
|