| | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.config.mybatis.MybatisPlusSaasConfig; |
| | | import org.jeecg.modules.dry.entity.DryEquipment; |
| | | import org.jeecg.modules.dry.service.IDryEqpTypeService; |
| | | import org.jeecg.modules.dry.service.IDryEquipmentService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | @Autowired |
| | | private IDryEquipmentService dryEquipmentService; |
| | | |
| | | @Autowired |
| | | private IDryEqpTypeService dryEqpTypeService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | Page<DryEquipment> page = new Page<DryEquipment>(pageNo, pageSize); |
| | | IPage<DryEquipment> pageList = dryEquipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value="查询所有干燥机", notes="查询所有干燥机") |
| | | @GetMapping(value = "/listAll") |
| | | public Result<List<DryEquipment>> queryAllEquipment(DryEquipment dryEquipment, HttpServletRequest req) { |
| | | //------------------------------------------------------------------------------------------------ |
| | | //是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】 |
| | | if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){ |
| | | dryEquipment.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(),0)); |
| | | } |
| | | //------------------------------------------------------------------------------------------------ |
| | | QueryWrapper<DryEquipment> queryWrapper = QueryGenerator.initQueryWrapper(dryEquipment, req.getParameterMap()); |
| | | |
| | | queryWrapper.orderByAsc("code"); |
| | | List<DryEquipment> eqps = dryEquipmentService.list(queryWrapper); |
| | | return Result.OK(eqps); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping(value = "/queryById") |
| | | public Result<DryEquipment> queryById(@RequestParam(name="id",required=true) String id) { |
| | | DryEquipment dryEquipment = dryEquipmentService.getById(id); |
| | | dryEquipment.setType(dryEqpTypeService.getById(dryEquipment.getType()).getName()); |
| | | if(dryEquipment==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |