2024-02-25 11:16:55 +08:00
|
|
|
package com.ics.admin.controller;
|
|
|
|
|
2024-03-02 16:18:40 +08:00
|
|
|
import com.alibaba.fastjson.JSONObject;
|
2024-02-25 11:16:55 +08:00
|
|
|
import com.ics.admin.domain.IcsCustomerStaff;
|
|
|
|
import com.ics.admin.service.IIcsCustomerStaffService;
|
|
|
|
import com.ics.common.constant.Constants;
|
|
|
|
import com.ics.common.core.controller.BaseController;
|
|
|
|
import com.ics.common.core.domain.R;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 企业员工 提供者
|
|
|
|
*
|
|
|
|
* @author ics
|
|
|
|
* @date 2024-02-19
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/admin/staff")
|
2024-02-25 16:43:09 +08:00
|
|
|
public class CustomerStaffController extends BaseController {
|
2024-02-25 11:16:55 +08:00
|
|
|
|
|
|
|
private final static String ACCESS_USERID = Constants.ACCESS_USERID;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private IIcsCustomerStaffService icsCustomerStaffService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询企业员工
|
|
|
|
*/
|
|
|
|
@GetMapping("get/{id}")
|
|
|
|
public IcsCustomerStaff get(@PathVariable("id") Long id) {
|
|
|
|
return icsCustomerStaffService.selectIcsCustomerStaffById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询企业员工列表
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("admin:staff:list")
|
|
|
|
@GetMapping("list")
|
|
|
|
public R list(IcsCustomerStaff icsCustomerStaff) {
|
|
|
|
startPage();
|
2024-03-02 16:18:40 +08:00
|
|
|
Integer staffId = getLoginStaffId();
|
|
|
|
icsCustomerStaff.setIcsCustomerId(staffId.longValue());
|
2024-02-25 16:43:09 +08:00
|
|
|
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
|
2024-02-25 11:16:55 +08:00
|
|
|
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增保存企业员工
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("admin:staff:add")
|
|
|
|
@PostMapping("save")
|
|
|
|
public R addSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
2024-03-02 16:18:40 +08:00
|
|
|
Integer staffId = getLoginStaffId();
|
|
|
|
icsCustomerStaff.setIcsCustomerId(staffId.longValue());
|
2024-02-25 11:16:55 +08:00
|
|
|
icsCustomerStaff.setCreateTime(new Date());
|
|
|
|
icsCustomerStaff.setCreateBy(getLoginName());
|
2024-02-25 16:43:09 +08:00
|
|
|
icsCustomerStaff.setDataType(Constants.CUSTOMER_STAFF);
|
2024-02-25 11:16:55 +08:00
|
|
|
return toAjax(icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改保存企业员工
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("admin:staff:edit")
|
|
|
|
@PostMapping("update")
|
|
|
|
public R editSave(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
|
|
|
icsCustomerStaff.setUpdateTime(new Date());
|
|
|
|
icsCustomerStaff.setUpdateBy(getLoginName());
|
|
|
|
return toAjax(icsCustomerStaffService.updateIcsCustomerStaff(icsCustomerStaff));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除企业员工
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("admin:staff:remove")
|
|
|
|
@PostMapping("remove")
|
|
|
|
public R remove(String ids) {
|
|
|
|
return toAjax(icsCustomerStaffService.deleteIcsCustomerStaffByIds(ids));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-03-02 17:13:10 +08:00
|
|
|
|
|
|
|
|
2024-02-25 11:16:55 +08:00
|
|
|
}
|