mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 09:39:37 +08:00
Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
095f33b5f1
@ -1,5 +1,6 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ics.admin.domain.IcsCustomerStaff;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.common.constant.Constants;
|
||||
@ -41,7 +42,8 @@ public class CustomerStaffController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(IcsCustomerStaff icsCustomerStaff) {
|
||||
startPage();
|
||||
icsCustomerStaff.setIcsCustomerId(1L);//临时设置,需要从用户信息中获取
|
||||
Integer staffId = getLoginStaffId();
|
||||
icsCustomerStaff.setIcsCustomerId(staffId.longValue());
|
||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
|
||||
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||
}
|
||||
@ -53,7 +55,8 @@ public class CustomerStaffController extends BaseController {
|
||||
@RequiresPermissions("admin:staff:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
icsCustomerStaff.setIcsCustomerId(1L);
|
||||
Integer staffId = getLoginStaffId();
|
||||
icsCustomerStaff.setIcsCustomerId(staffId.longValue());
|
||||
icsCustomerStaff.setCreateTime(new Date());
|
||||
icsCustomerStaff.setCreateBy(getLoginName());
|
||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
|
||||
|
@ -113,6 +113,16 @@ public class BaseController {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getLoginStaffId() {
|
||||
Token token = SubjectUtil.getToken(getRequest());
|
||||
String value = valueOperations.get(ACCESS_USERID + ":" + token.getUserId());
|
||||
JSONObject jo = StringUtils.isEmpty(value) ? null : JSON.parseObject(value, JSONObject.class);
|
||||
if (jo != null && jo.containsKey("staffId")) {
|
||||
return (Integer)jo.get("staffId");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
|
@ -76,4 +76,9 @@ public class CurrentUserVO {
|
||||
*/
|
||||
private Boolean isAdmin;
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ public class PublishFactory {
|
||||
userOnline.setDeptId(user.getDept().getId());
|
||||
userOnline.setDeptName(user.getDept().getDeptName());
|
||||
}
|
||||
userOnline.setStaffId(user.getStaffId());
|
||||
// 发布事件
|
||||
SpringContextHolder.publishEvent(new UserOnlineEvent(userOnline));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user