mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
+14
-1
@@ -1,20 +1,26 @@
|
||||
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.framework.organ.core.context.OrganContextHolder;
|
||||
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;
|
||||
|
||||
import javax.validation.*;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
@@ -125,5 +131,12 @@ public class MachineController {
|
||||
return success(machineService.getMachineTree(organId));
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取机台精简信息列表", description = "主要用于前端的下拉选项")
|
||||
public CommonResult<List<MachineSimpleRespVO>> getSimpleDeptList(@RequestParam(required = false) Long organId) {
|
||||
organId = organId == null ? OrganContextHolder.getOrganId() : organId;
|
||||
List<MachineSimpleRespVO> list = machineService.simpleList(organId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
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(Long organId);
|
||||
}
|
||||
+11
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
@@ -290,6 +291,16 @@ public class MachineServiceImpl implements MachineService {
|
||||
return machineMapper.selectPage(pageParam, new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
@OrganIgnore
|
||||
public List<MachineSimpleRespVO> simpleList(Long organId) {
|
||||
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.select(MachineDO::getId, MachineDO::getName)
|
||||
.eq(MachineDO::getOrganId, organId)
|
||||
);
|
||||
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