|
@@ -23,6 +23,7 @@ import com.fs.his.vo.FsDoctorBillListSVO;
|
|
|
import com.fs.his.vo.FsDoctorExtractListSVO;
|
|
|
import com.fs.im.config.IMConfig;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
|
+import com.fs.im.service.OpenIMService;
|
|
|
import com.fs.sms.service.SmsService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
@@ -112,7 +113,6 @@ public class DoctorController extends AppBaseController {
|
|
|
//获取管理员token
|
|
|
String userId = userIdMap.get("userId");
|
|
|
String adminToken = openIMService.getAdminToken();
|
|
|
-
|
|
|
JSONObject requestBody = new JSONObject();
|
|
|
// 解析响应
|
|
|
if (StringUtil.isNotEmpty(adminToken)) {
|
|
@@ -121,7 +121,7 @@ public class DoctorController extends AppBaseController {
|
|
|
requestBody = new JSONObject();
|
|
|
userIds.add(userId);
|
|
|
requestBody.put("checkUserIDs", userIds);
|
|
|
- String body = HttpRequest.post(IMConfig.URL+"/user/account_check")
|
|
|
+ String body = HttpRequest.post("https://web.im.cdwjyyh.com/api/user/account_check")
|
|
|
.header("operationID", String.valueOf(System.currentTimeMillis()))
|
|
|
.header("token", adminToken)
|
|
|
.body(requestBody.toString())
|
|
@@ -129,13 +129,12 @@ public class DoctorController extends AppBaseController {
|
|
|
.body();
|
|
|
JSONObject jsonObject = new JSONObject(body);
|
|
|
JSONArray results = jsonObject.getJSONObject("data").getJSONArray("results");
|
|
|
- System.out.println("查询用户结果:"+results);
|
|
|
if (results != null && results.length() > 0) {
|
|
|
JSONObject resultObj = results.getJSONObject(0);
|
|
|
int accountStatus = resultObj.getInt("accountStatus");
|
|
|
//未注册自动注册
|
|
|
if (accountStatus==0){
|
|
|
- String s = userId.replaceFirst("^"+"D", "");
|
|
|
+ String s = userId.replaceFirst("^D", "");
|
|
|
FsDoctor fsDoctor = doctorService.selectFsDoctorByDoctorId(Long.parseLong(s));
|
|
|
if (null==fsDoctor){
|
|
|
return R.error("用户不存在");
|
|
@@ -144,30 +143,28 @@ public class DoctorController extends AppBaseController {
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
map.put("userID",userId);
|
|
|
map.put("nickname",fsDoctor.getDoctorName());
|
|
|
- map.put("faceURL",StringUtils.isEmpty(fsDoctor.getAvatar())?"https://cos.his.cdwjyyh.com/fs/20240926/420728ee06e54575ba82665dedb4756b.png":fsDoctor.getAvatar());
|
|
|
+ map.put("faceURL",fsDoctor.getAvatar());
|
|
|
users.add(map);
|
|
|
requestBody = new JSONObject();
|
|
|
- //userIds.add(userId);
|
|
|
+ userIds.add(userId);
|
|
|
requestBody.put("users", users);
|
|
|
- String body1 = HttpRequest.post(IMConfig.URL+"/user/user_register")
|
|
|
+ HttpRequest.post("https://web.im.cdwjyyh.com/api/user/user_register")
|
|
|
.header("operationID", String.valueOf(System.currentTimeMillis()))
|
|
|
.header("token", adminToken).body(requestBody.toString()).execute().body();
|
|
|
- log.info("注册结果:"+body1);
|
|
|
}
|
|
|
} else {
|
|
|
return R.error("返回结果为空");
|
|
|
}
|
|
|
+ /* HashMap<String, String> tokenMap = new HashMap<>();
|
|
|
+ tokenMap.put("platformID","1");
|
|
|
+ tokenMap.put("userID",userId);*/
|
|
|
requestBody = new JSONObject();
|
|
|
requestBody.put("platformID",5);
|
|
|
requestBody.put("userID",userId);
|
|
|
- String body1 = HttpRequest.post(IMConfig.URL+"/auth/get_user_token")
|
|
|
+ String body1 = HttpRequest.post("https://web.im.cdwjyyh.com/api/auth/get_user_token")
|
|
|
.header("operationID", String.valueOf(System.currentTimeMillis()))
|
|
|
.header("token", adminToken)
|
|
|
.body(requestBody.toString()).execute().body();
|
|
|
- System.out.println("operationID"+System.currentTimeMillis());
|
|
|
- System.out.println("adimtoken"+adminToken);
|
|
|
- System.out.println("IPad地址"+IMConfig.URL+"/api/auth/get_user_token");
|
|
|
- System.out.println("json接送内容:"+body1);
|
|
|
JSONObject userJson = new JSONObject(body1);
|
|
|
JSONObject userData = userJson.getJSONObject("data");
|
|
|
String userToken = userData.getString("token");
|