puzhibing
2024-01-30 03f1f3372a10a08f96f3308bfa099e86a55046d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.ruoyi.system.controller.conslole;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.dto.MerEditUserDto;
import com.ruoyi.system.api.domain.poji.sys.SysStaff;
import com.ruoyi.system.service.staff.SysStaffService;
import com.ruoyi.system.service.staff.SysWxCpService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * @author cheny
 */
@Api(value = "平台端员工相关接口", tags = "平台端员工相关接口", description = "平台端员工相关接口")
@RestController
@RequestMapping("/staff")
public class StaffController {
    @Resource
    private SysStaffService sysStaffService;
 
    @Resource
    private SysWxCpService sysWxCpService;
 
    /**
     * @description  判断员工是否领导
     * @author  jqs
     * @date    2023/7/19 19:45
     * @param
     * @return  Boolean
     */
    @PostMapping("/isLeader")
    public Boolean isLeader() {
        Long userId = SecurityUtils.getUserId();
        SysStaff sysStaff = sysStaffService.getByUserId(userId);
        if(null!=sysStaff){
            return sysStaffService.getByUserId(userId).getHeadFlag().equals("1") ? true : false;
        }
        return false;
    }
 
    /**
     * @description  编辑商户员工
     * @author  jqs
     * @date    2023/7/19 19:44
     * @param merEditUserDto
     * @return  R
     */
    @PostMapping("/editSysStaffInfo")
    public R editUserInfo(@RequestBody MerEditUserDto merEditUserDto){
        sysStaffService.editSysStaffInfo(merEditUserDto);
        return R.ok();
    }
 
}