|
@@ -55,6 +55,18 @@ public class CustomerService {
|
|
|
* 指定用户为客服
|
|
|
*/
|
|
|
public int update(Customer customer) {
|
|
|
+ Customer c = customerDao.get(customer.getId());
|
|
|
+ JSONObject js = new JSONObject();
|
|
|
+ if (customer.getNickName() != null) {
|
|
|
+ js.put("nickname", customer.getNickName());
|
|
|
+ }
|
|
|
+ if (customer.getAvatarUrl() != null) {
|
|
|
+ js.put("avatarUrl", customer.getAvatarUrl());
|
|
|
+ }
|
|
|
+ if (js.size() != 0) {
|
|
|
+ String str = WeChatUtil.httpPost("https://www.waywish.com/im/user/update", js, getToken(c.getCustomerId()));
|
|
|
+ log.info("updateCustomerChatUser=" + str);
|
|
|
+ }
|
|
|
return customerDao.update(customer);
|
|
|
}
|
|
|
|
|
@@ -102,16 +114,4 @@ public class CustomerService {
|
|
|
return customerDao.getOrganizationId(organizationId, userId);
|
|
|
}
|
|
|
|
|
|
- @Transactional
|
|
|
- public int updateInfo(Customer customer) {
|
|
|
- Customer c = customerDao.get(customer.getId());
|
|
|
- String token = getToken(c.getCustomerId());
|
|
|
- JSONObject js = new JSONObject();
|
|
|
- js.put("nickname", customer.getNickName());
|
|
|
- js.put("avatarUrl", customer.getAvatarUrl());
|
|
|
- String str = WeChatUtil.httpPost("https://www.waywish.com/im/user/update", js, token);
|
|
|
- log.info("updateCustomerChatUser=" + str);
|
|
|
- return customerDao.update(customer);
|
|
|
- }
|
|
|
-
|
|
|
}
|