mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 03:49:36 +08:00
修改了企业管理员的问题
This commit is contained in:
parent
fa4a9d311b
commit
9db76e7dcc
@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
import org.wf.jwtp.util.SubjectUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -131,7 +132,15 @@ public class CustomerController extends BaseController {
|
|||||||
public R list(Customer customer) {
|
public R list(Customer customer) {
|
||||||
startPage();
|
startPage();
|
||||||
customer.setDeleteFlag(0);
|
customer.setDeleteFlag(0);
|
||||||
|
|
||||||
|
System.out.println(this.getLoginCustomerId());
|
||||||
|
// this.get
|
||||||
|
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"admin");
|
||||||
|
if (isAdmin){
|
||||||
|
customer.setCustomerId(Long.valueOf(this.getLoginCustomerId()));
|
||||||
|
}
|
||||||
List<Customer> customers = customerService.selectCustomerList(customer);
|
List<Customer> customers = customerService.selectCustomerList(customer);
|
||||||
|
|
||||||
for (Customer customer1 : customers) {
|
for (Customer customer1 : customers) {
|
||||||
Long tenantId = customer1.getTenantId();
|
Long tenantId = customer1.getTenantId();
|
||||||
Tenant tenant = tenantService.selectTenantById(tenantId);
|
Tenant tenant = tenantService.selectTenantById(tenantId);
|
||||||
|
@ -137,7 +137,6 @@ public class CustomerStaffController extends BaseController {
|
|||||||
if (customerId != null && !"".equals(customerId)) {
|
if (customerId != null && !"".equals(customerId)) {
|
||||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
||||||
}
|
}
|
||||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
|
||||||
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,5 +435,7 @@ public class Customer extends BaseEntity<Customer> {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String buildingName;
|
private String buildingName;
|
||||||
|
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -28,6 +28,7 @@ public interface CustomerMapper extends BaseMapper<Customer> {
|
|||||||
* @param customer 客户管理
|
* @param customer 客户管理
|
||||||
* @return 客户管理集合
|
* @return 客户管理集合
|
||||||
*/
|
*/
|
||||||
|
|
||||||
List<Customer> selectCustomerList(Customer customer);
|
List<Customer> selectCustomerList(Customer customer);
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@
|
|||||||
<if test="deleteFlag != null"> and ic.delete_flag = #{deleteFlag} </if>
|
<if test="deleteFlag != null"> and ic.delete_flag = #{deleteFlag} </if>
|
||||||
<if test="parkId != null and parkId != '' "> and ic.park_id = #{parkId} </if>
|
<if test="parkId != null and parkId != '' "> and ic.park_id = #{parkId} </if>
|
||||||
<if test="tenantId != null and tenantId != '' "> and ic.tenant_id = #{tenantId} </if>
|
<if test="tenantId != null and tenantId != '' "> and ic.tenant_id = #{tenantId} </if>
|
||||||
|
<if test="customerId != null and customerId != '' "> and ic.id = #{customerId} </if>
|
||||||
</where>
|
</where>
|
||||||
order by ic.create_time desc
|
order by ic.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
@ -131,12 +131,12 @@ public class BaseController {
|
|||||||
* 获取企业id
|
* 获取企业id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long getLoginCustomerId() {
|
public Integer getLoginCustomerId() {
|
||||||
Token token = SubjectUtil.getToken(getRequest());
|
Token token = SubjectUtil.getToken(getRequest());
|
||||||
String value = valueOperations.get(ACCESS_USERID + ":" + token.getUserId());
|
String value = valueOperations.get(ACCESS_USERID + ":" + token.getUserId());
|
||||||
JSONObject jo = StringUtils.isEmpty(value) ? null : JSON.parseObject(value, JSONObject.class);
|
JSONObject jo = StringUtils.isEmpty(value) ? null : JSON.parseObject(value, JSONObject.class);
|
||||||
if (jo != null && jo.containsKey("customerId")) {
|
if (jo != null && jo.containsKey("customerId")) {
|
||||||
return (Long)jo.get("customerId");
|
return (Integer)jo.get("customerId");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user