art: 设备管理-用户选择-根据岗位选择用户 问题修改
| | |
| | | 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(equipmentId, productionId, positionCode); |
| | | List<UserSelector> list = sysUserService.selectOperatorList(equipmentCode, productionId, positionCode); |
| | | return Result.ok(list); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 选择用户 |
| | | * @param equipmentId 选择的设备ID |
| | | * @param equipmentCode 选择的设备ID |
| | | * @param productionId 选择的车间ID |
| | | * @param positionCode 岗位编号 |
| | | * @return |
| | | */ |
| | | List<UserSelector> selectOperatorList(String equipmentId, String productionId, String positionCode); |
| | | List<UserSelector> selectOperatorList(String equipmentCode, String productionId, String positionCode); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserSelector> selectOperatorList(String equipmentId, String productionId, String positionCode) { |
| | | public List<UserSelector> selectOperatorList(String equipmentCode, String productionId, String positionCode) { |
| | | LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(SysUser::getPost, positionCode); |
| | | if(StringUtils.isNotBlank(equipmentId)) { |
| | | if(StringUtils.isNotBlank(equipmentCode)) { |
| | | queryWrapper.isNull(SysUser::getEquipmentIds); |
| | | queryWrapper.or().eq(SysUser::getEquipmentIds, ""); |
| | | queryWrapper.or().like(SysUser::getEquipmentIds, equipmentId); |
| | | queryWrapper.or().like(SysUser::getEquipmentIds, equipmentCode); |
| | | } |
| | | if(StringUtils.isNotBlank(productionId)) { |
| | | queryWrapper.exists("select 1 from mdc_user_production t where t.user_id=id and t.pro_id={0}", productionId); |