|
@@ -49,7 +49,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
@Autowired
|
|
|
private IAssetService assetService;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
*
|
|
@@ -71,7 +71,7 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
IPage<Asset> pageList = assetService.page(page, queryWrapper);
|
|
|
return Result.ok(pageList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
*
|
|
@@ -85,7 +85,7 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
assetService.save(asset);
|
|
|
return Result.ok("添加成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
|
@@ -99,7 +99,7 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
assetService.updateById(asset);
|
|
|
return Result.ok("编辑成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id删除
|
|
|
*
|
|
@@ -113,7 +113,7 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
assetService.removeById(id);
|
|
|
return Result.ok("删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
@@ -127,7 +127,7 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
this.assetService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
return Result.ok("批量删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id查询
|
|
|
*
|
|
@@ -168,4 +168,28 @@ public class AssetController extends JeecgController<Asset, IAssetService> {
|
|
|
return super.importExcel(request, response, Asset.class);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询通过状态正在使用和闲置
|
|
|
+ *
|
|
|
+ * @param asset
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "固定资产-分页列表查询")
|
|
|
+ @ApiOperation(value="固定资产-分页列表查询", notes="固定资产-分页列表查询")
|
|
|
+ @GetMapping(value = "/listByStatus")
|
|
|
+ public Result<?> queryPageListByStatus(Asset asset,
|
|
|
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<Asset> queryWrapper = QueryGenerator.initQueryWrapper(asset, req.getParameterMap());
|
|
|
+ queryWrapper.eq("state","正在使用").or().eq("state","闲置");
|
|
|
+ Page<Asset> page = new Page<Asset>(pageNo, pageSize);
|
|
|
+ IPage<Asset> pageList = assetService.page(page, queryWrapper);
|
|
|
+ return Result.ok(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
}
|