|
@@ -10,8 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ruoyi.asset.domain.TbAssetBorrowRecord;
|
|
|
import com.ruoyi.asset.domain.TbAssetCategory;
|
|
|
import com.ruoyi.asset.domain.dto.TbAssetDTO;
|
|
|
+import com.ruoyi.asset.domain.enums.TbAssetStatusEnum;
|
|
|
import com.ruoyi.asset.mapper.TbAssetBorrowRecordMapper;
|
|
|
import com.ruoyi.asset.mapper.TbAssetCategoryMapper;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.UserUtils;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
@@ -248,4 +250,19 @@ public class TbAssetServiceImpl extends ServiceImpl<TbAssetMapper, TbAsset> impl
|
|
|
|
|
|
return assetDTOList;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult countTbAsset() {
|
|
|
+ int allAsset = tbAssetMapper.countTbAssetAll();
|
|
|
+ int faultAsset = tbAssetMapper.countTbAssetByStatus(TbAssetStatusEnum.fault.getStatusCode());
|
|
|
+ int scrapAsset = tbAssetMapper.countTbAssetByStatus(TbAssetStatusEnum.scrap.getStatusCode());
|
|
|
+ int borrowAsset = tbAssetBorrowRecordMapper.countTbAssetBorrowRecordForNotReturn();
|
|
|
+
|
|
|
+ Map<String, Integer> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("allAsset", allAsset); // 全部设备
|
|
|
+ resultMap.put("faultAsset", faultAsset); // 故障设备
|
|
|
+ resultMap.put("scrapAsset", scrapAsset); // 报废设备
|
|
|
+ resultMap.put("borrowAsset", borrowAsset); // 借出设备
|
|
|
+ return AjaxResult.success("查询成功", resultMap);
|
|
|
+ }
|
|
|
}
|