zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamUserSelectController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
package org.jeecg.modules.eam.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.eam.entity.EamEquipment;
import org.jeecg.modules.eam.service.IEamEquipmentService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.UserSelector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @Description: ç”¨æˆ·é€‰æ‹©
 * @Author: jeecg-boot
 * @Date: 2025-03-19
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "用户选择")
@RestController
@RequestMapping("/eam/user_select")
public class EamUserSelectController {
    @Autowired
    private ISysUserService sysUserService;
    @Autowired
    private IEamEquipmentService eamEquipmentService;
    @ApiOperation(value = "用户选择-选择操作人列表查询", notes = "用户选择-选择操作人列表查询")
    @GetMapping(value = "/list")
    public Result<?> selectOperatorList(@RequestParam(required = false, value = "equipmentId") String equipmentId,
                                        @RequestParam("positionCode") String positionCode) {
        String productionId = null;
        String equipmentCode = null;
        if (StringUtils.isNotBlank(equipmentId)) {
            EamEquipment equipment = eamEquipmentService.getById(equipmentId);
            if(equipment != null) {
                productionId = equipment.getOrgId();
                equipmentCode = equipment.getEquipmentCode();
            }
        }
        List<UserSelector> list = sysUserService.selectOperatorList(equipmentCode, productionId, positionCode);
        return Result.ok(list);
    }
}