mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增机台下拉选项接口
This commit is contained in:
+8
-1
@@ -1,16 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
import com.cf.imes.module.system.service.machine.MachineTemplateService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -125,5 +126,11 @@ public class MachineController {
|
||||
return success(machineService.getMachineTree(organId));
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取机台精简信息列表", description = "主要用于前端的下拉选项")
|
||||
public CommonResult<List<MachineSimpleRespVO>> getSimpleDeptList() {
|
||||
List<MachineSimpleRespVO> list = machineService.simpleList();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
public class MachineSimpleRespVO {
|
||||
@Schema(description = "机台id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机台名称")
|
||||
private String name;
|
||||
}
|
||||
+2
@@ -80,4 +80,6 @@ public interface MachineService {
|
||||
OrganMachineResp organMachineByOrganId(Long organId);
|
||||
|
||||
PageResult<MachineDO> page(MachinePageReqVO pageParam);
|
||||
|
||||
List<MachineSimpleRespVO> simpleList();
|
||||
}
|
||||
+8
@@ -290,6 +290,14 @@ public class MachineServiceImpl implements MachineService {
|
||||
return machineMapper.selectPage(pageParam, new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineSimpleRespVO> simpleList() {
|
||||
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.select(MachineDO::getId, MachineDO::getName)
|
||||
);
|
||||
return BeanUtils.toBean(machineDOS, MachineSimpleRespVO.class);
|
||||
}
|
||||
|
||||
private void validateExists(Long id) {
|
||||
if (machineMapper.selectById(id) == null) {
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
|
||||
Reference in New Issue
Block a user