获得机台树Bug修改

This commit is contained in:
liuzhaotian
2024-06-19 10:29:30 +08:00
parent 58d84d5b7a
commit 208bd42db7
3 changed files with 6 additions and 5 deletions
@@ -127,8 +127,8 @@ public class MachineController {
@GetMapping("getMachineTree") @GetMapping("getMachineTree")
@Operation(summary = "获得机台树") @Operation(summary = "获得机台树")
//@PreAuthorize("@ss.hasPermission('machine::query')") //@PreAuthorize("@ss.hasPermission('machine::query')")
public CommonResult<Map<Integer, List<MachineVO>>> getMachineTree(@RequestParam(required = false) Long organId ,@RequestParam(required = false) Long type) { public CommonResult<Map<Integer, List<MachineVO>>> getMachineTree(@RequestParam(required = false) Long type) {
return success(machineService.getMachineTree(organId,type)); return success(machineService.getMachineTree(type));
} }
@GetMapping(value = {"/list-all-simple", "/simple-list"}) @GetMapping(value = {"/list-all-simple", "/simple-list"})
@@ -71,7 +71,7 @@ public interface MachineService {
List<MachineDO> list(Collection<Long> ids); List<MachineDO> list(Collection<Long> ids);
Map<Integer, List<MachineVO>> getMachineTree(Long organId,Long type); Map<Integer, List<MachineVO>> getMachineTree(Long type);
Boolean auth(MachineOrgAuthReq vo); Boolean auth(MachineOrgAuthReq vo);
@@ -44,6 +44,7 @@ import javax.annotation.Resource;
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR; import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*; import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/** /**
@@ -236,9 +237,9 @@ public class MachineServiceImpl implements MachineService {
} }
@Override @Override
public Map<Integer, List<MachineVO>> getMachineTree(Long organId,Long type) { public Map<Integer, List<MachineVO>> getMachineTree(Long type) {
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>() List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
.eqIfPresent(MachineDO::getOrganId, organId) .eqIfPresent(MachineDO::getOrganId, getUserOrganId())
.eqIfPresent(MachineDO::getMachineType, type) .eqIfPresent(MachineDO::getMachineType, type)
.select(MachineDO::getName, MachineDO::getMachineType, MachineDO::getId, MachineDO::getLabelId, MachineDO::getCreateTime) .select(MachineDO::getName, MachineDO::getMachineType, MachineDO::getId, MachineDO::getLabelId, MachineDO::getCreateTime)
); );