Commit 5636a627 authored by luzhuang's avatar luzhuang

mt后台调通

parent 9901faa4
......@@ -67,7 +67,7 @@ public interface ContactFeignClient {
/**
* 根据用户id获取用户信息(多个)
*/
@RequestMapping(value = "/account/get_user_head",method = RequestMethod.POST)
@RequestMapping(value = "/account/get_user_head",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
Ret<List<MTAccountIdRspDTO>> accountGetUserHead(@RequestBody MTUserGetsAccountReqDTO mtUserGetsReqDTO,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
......@@ -243,7 +243,7 @@ public interface ContactFeignClient {
/**
* 根据部门ids 获取部门及子部门多有人员id(未去重)
*/
@RequestMapping(value = "/api/sm/user/get_sub_userIds_by_dept_ids",method = RequestMethod.POST)
@RequestMapping(value = "/api/sm/user/get_sub_userIds_by_dept_ids",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
Ret<List<String>> getSubUserIdsByDeptIds(@RequestBody GetSubUserIdsByDeptIdsReqDTO getSubUserIdsByDeptIdsReqDTO,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
......
......@@ -5,6 +5,7 @@ import org.rcisoft.common.util.feignDto.HaveJurisdictionReqDTO;
import org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO;
import org.rcisoft.core.result.Ret;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -13,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* 智信消息客户端接口
*/
@FeignClient(value = "ZX-MICROAPP", fallback = MicroappFeignClientFallBack.class)
@FeignClient(value = "spcl-sm-app", fallback = MicroappFeignClientFallBack.class)
public interface MicroappFeignClient {
/**
......@@ -46,7 +47,7 @@ public interface MicroappFeignClient {
* @param zxAccountId
* @return
*/
@RequestMapping(value = "/micro_app/haveJurisdictionUserFast",method = RequestMethod.POST)
@RequestMapping(value = "/micro_app/haveJurisdictionUserFast",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
Ret haveJurisdictionUserFast(@RequestBody HaveJurisdictionReqDTO haveJurisdictionReqDTO,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
......
......@@ -5,6 +5,7 @@ import org.rcisoft.core.result.NotiRet;
import org.rcisoft.core.result.Ret;
import org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -15,14 +16,14 @@ import org.springframework.web.bind.annotation.RequestParam;
* 智信消息客户端接口
*/
@Component
@FeignClient(value = "ZX-NOTIFICATION", fallback = NotificationFeignClientFallBack.class)
@FeignClient(value = "spcl-sm-notice", fallback = NotificationFeignClientFallBack.class)
public interface NotificationFeignClient {
/**
* 发送智信消息
* @return
*/
@RequestMapping(value = "/notification/send",method = RequestMethod.POST)
@RequestMapping(value = "/notification/send",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
NotiRet sendMessage(@RequestBody MTNotificationSendReqDTO mtNotificationSendReqDTO,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId
......
......@@ -190,16 +190,7 @@ public class MTCotactApiRequestClient {
* @return
*/
public List<MTAccountIdRspDTO> accountGetUserHead(MTUserGetsAccountReqDTO mtUserGetsReqDTO) {
if("dev".equalsIgnoreCase(serverType)){
login();
Map<String, String> headerParams = new HashMap<>(2);
headerParams.put("clientType", "app");
headerParams.put("Authorization", "Bearer " + ACCESS_TOKEN);
String json = okHttpUtil.postForJson(api + "contact/v1/account/get_user_head", JSON.toJSONString(mtUserGetsReqDTO), headerParams);
if(StringUtils.isNotEmpty(json)) {
return JSON.parseObject(json, new TypeReference<Ret<List<MTAccountIdRspDTO>>>() {
}).getData();
}
if (mtUserGetsReqDTO.getUserIds() == null || mtUserGetsReqDTO.getUserIds().size() < 1){
return new ArrayList<>();
}
return contactFeignClient.accountGetUserHead(mtUserGetsReqDTO,zxClientType,zxAccountId).getData();
......
......@@ -139,9 +139,9 @@ public class MTNotificationApiRequestClient {
List<String> haveJurisAccountIds = new ArrayList<>();
List<String> getUserAccountList = new ArrayList<>();
List<Long> getUserAccountLongList = (List<Long>)haveJurisList.getData();
List<String> getUserAccountLongList = (List<String>)haveJurisList.getData();
getUserAccountLongList.forEach(getUserAccount ->{
getUserAccountList.add(String.valueOf(getUserAccount));
getUserAccountList.add(getUserAccount);
});
MTUserGetsAccountReqDTO mtUserGetsReqDTO = new MTUserGetsAccountReqDTO(message.getCorpId(),getUserAccountList);
......
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