工厂员工管理 接口权限修改
This commit is contained in:
parent
d4241528eb
commit
a246296e1e
@ -7,11 +7,11 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.device.cameradevice.vo.CameraUpdateStatusReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.factoryinfo.FactoryInfoService;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -40,6 +40,9 @@ public class FactoryInfoController {
|
||||
@Resource
|
||||
private FactoryInfoService factoryInfoService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工厂信息")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:create')")
|
||||
@ -77,9 +80,19 @@ public class FactoryInfoController {
|
||||
@Operation(summary = "获得工厂信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
|
||||
public CommonResult<FactoryInfoDO> getFactoryInfo(@RequestParam("id") Long id) {
|
||||
public CommonResult<FactoryInfoRespVO> getFactoryInfo(@RequestParam("id") Long id) {
|
||||
|
||||
FactoryInfoDO factoryInfo = factoryInfoService.getFactoryInfo(id);
|
||||
return success(factoryInfo);
|
||||
FactoryInfoRespVO respVO = BeanUtils.toBean(factoryInfo, FactoryInfoRespVO.class);
|
||||
|
||||
// 获取部门信息
|
||||
DeptRespDTO respDTO = deptApi.getDeptByFactoryId(factoryInfo.getId()).getCheckedData();
|
||||
if (respDTO != null) {
|
||||
// 设置负责人信息
|
||||
respVO.setLeaderUserId(respDTO.getLeaderUserId());
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
|
Loading…
Reference in New Issue
Block a user