电子档案-资产档案
parent
67ef100fe2
commit
2b8d5a6dfd
@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-electronic</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>yudao-module-ea-api</module>
|
||||
<module>yudao-module-ea-biz</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-archives-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-system-biz</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-electronic</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-ea-api</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
package cn.iocoder.yudao.module.ea.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode ELECTRONIC_ASSETS_NOT_EXISTS = new ErrorCode(300010, "资产档案不存在");
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-electronic</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-ea-biz</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-ea-api</artifactId>
|
||||
<version>1.7.3-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo.*;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO;
|
||||
import cn.iocoder.yudao.module.ea.convert.electronicassets.ElectronicAssetsConvert;
|
||||
import cn.iocoder.yudao.module.ea.service.electronicassets.ElectronicAssetsService;
|
||||
|
||||
@Tag(name = "管理后台 - 资产档案")
|
||||
@RestController
|
||||
@RequestMapping("/ea/electronic")
|
||||
@Validated
|
||||
public class ElectronicAssetsController {
|
||||
|
||||
@Resource
|
||||
private ElectronicAssetsService electronicAssetsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建资产档案")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:create')")
|
||||
public CommonResult<Long> createElectronicAssets(@Valid @RequestBody ElectronicAssetsCreateReqVO createReqVO) {
|
||||
return success(electronicAssetsService.createElectronicAssets(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新资产档案")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:update')")
|
||||
public CommonResult<Boolean> updateElectronicAssets(@Valid @RequestBody ElectronicAssetsUpdateReqVO updateReqVO) {
|
||||
electronicAssetsService.updateElectronicAssets(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除资产档案")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:delete')")
|
||||
public CommonResult<Boolean> deleteElectronicAssets(@RequestParam("id") Long id) {
|
||||
electronicAssetsService.deleteElectronicAssets(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得资产档案")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:query')")
|
||||
public CommonResult<ElectronicAssetsRespVO> getElectronicAssets(@RequestParam("id") Long id) {
|
||||
ElectronicAssetsDO electronicAssets = electronicAssetsService.getElectronicAssets(id);
|
||||
return success(ElectronicAssetsConvert.INSTANCE.convert(electronicAssets));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得资产档案列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:query')")
|
||||
public CommonResult<List<ElectronicAssetsRespVO>> getElectronicAssetsList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ElectronicAssetsDO> list = electronicAssetsService.getElectronicAssetsList(ids);
|
||||
return success(ElectronicAssetsConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得资产档案分页")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:query')")
|
||||
public CommonResult<PageResult<ElectronicAssetsRespVO>> getElectronicAssetsPage(@Valid ElectronicAssetsPageReqVO pageVO) {
|
||||
PageResult<ElectronicAssetsDO> pageResult = electronicAssetsService.getElectronicAssetsPage(pageVO);
|
||||
return success(ElectronicAssetsConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出资产档案 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('ea:electronic:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportElectronicAssetsExcel(@Valid ElectronicAssetsExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ElectronicAssetsDO> list = electronicAssetsService.getElectronicAssetsList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ElectronicAssetsExcelVO> datas = ElectronicAssetsConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "资产档案.xls", "数据", ElectronicAssetsExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 资产档案创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ElectronicAssetsCreateReqVO extends ElectronicAssetsBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 资产档案 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicAssetsExcelVO {
|
||||
|
||||
@ExcelProperty("资产档案id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("业务实体id")
|
||||
private Long companyId;
|
||||
|
||||
@ExcelProperty("业务实体名称")
|
||||
private String company;
|
||||
|
||||
@ExcelProperty("部门id")
|
||||
private Long deptId;
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ExcelProperty("资产名称")
|
||||
private String assetName;
|
||||
|
||||
@ExcelProperty("资产描述")
|
||||
private String assetDescription;
|
||||
|
||||
@ExcelProperty("资产类型")
|
||||
private String assetType;
|
||||
|
||||
@ExcelProperty("购买日期")
|
||||
private LocalDateTime purchaseDate;
|
||||
|
||||
@ExcelProperty("报废日期")
|
||||
private LocalDateTime disposalDate;
|
||||
|
||||
@ExcelProperty("资产状态")
|
||||
private String assetStatus;
|
||||
|
||||
@ExcelProperty("资产价格")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ExcelProperty("资产数量")
|
||||
private Integer assetQuantity;
|
||||
|
||||
@ExcelProperty("购买渠道")
|
||||
private String purchaseChannel;
|
||||
|
||||
@ExcelProperty("文件来源")
|
||||
private String source;
|
||||
|
||||
@ExcelProperty("年度")
|
||||
private String year;
|
||||
|
||||
@ExcelProperty("月份")
|
||||
private String period;
|
||||
|
||||
@ExcelProperty("借阅状态")
|
||||
private String borrowStatus;
|
||||
|
||||
@ExcelProperty("纸档位置")
|
||||
private String position;
|
||||
|
||||
@ExcelProperty("完整性")
|
||||
private String cherks;
|
||||
|
||||
@ExcelProperty("归档id")
|
||||
private Long recordId;
|
||||
|
||||
@ExcelProperty("归档状态")
|
||||
private String fileStatus;
|
||||
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("制单人")
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 资产档案分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ElectronicAssetsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务实体id", example = "5984")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "业务实体名称")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "部门id", example = "32352")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", example = "芋艿")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@Schema(description = "资产名称", example = "王五")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "资产描述", example = "你说的对")
|
||||
private String assetDescription;
|
||||
|
||||
@Schema(description = "资产类型", example = "2")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "购买日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] purchaseDate;
|
||||
|
||||
@Schema(description = "报废日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] disposalDate;
|
||||
|
||||
@Schema(description = "资产状态", example = "1")
|
||||
private String assetStatus;
|
||||
|
||||
@Schema(description = "资产价格", example = "21847")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@Schema(description = "资产数量")
|
||||
private Integer assetQuantity;
|
||||
|
||||
@Schema(description = "购买渠道")
|
||||
private String purchaseChannel;
|
||||
|
||||
@Schema(description = "文件来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "年度")
|
||||
private String year;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private String period;
|
||||
|
||||
@Schema(description = "借阅状态", example = "2")
|
||||
private String borrowStatus;
|
||||
|
||||
@Schema(description = "纸档位置")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "完整性")
|
||||
private String cherks;
|
||||
|
||||
@Schema(description = "归档id", example = "5964")
|
||||
private Long recordId;
|
||||
|
||||
@Schema(description = "归档状态", example = "1")
|
||||
private String fileStatus;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "制单人")
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 资产档案 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ElectronicAssetsRespVO extends ElectronicAssetsBaseVO {
|
||||
|
||||
@Schema(description = "资产档案id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17700")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 资产档案更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ElectronicAssetsUpdateReqVO extends ElectronicAssetsBaseVO {
|
||||
|
||||
@Schema(description = "资产档案id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17700")
|
||||
@NotNull(message = "资产档案id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.ea.convert.electronicassets;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo.*;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO;
|
||||
|
||||
/**
|
||||
* 资产档案 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ElectronicAssetsConvert {
|
||||
|
||||
ElectronicAssetsConvert INSTANCE = Mappers.getMapper(ElectronicAssetsConvert.class);
|
||||
|
||||
ElectronicAssetsDO convert(ElectronicAssetsCreateReqVO bean);
|
||||
|
||||
ElectronicAssetsDO convert(ElectronicAssetsUpdateReqVO bean);
|
||||
|
||||
ElectronicAssetsRespVO convert(ElectronicAssetsDO bean);
|
||||
|
||||
List<ElectronicAssetsRespVO> convertList(List<ElectronicAssetsDO> list);
|
||||
|
||||
PageResult<ElectronicAssetsRespVO> convertPage(PageResult<ElectronicAssetsDO> page);
|
||||
|
||||
List<ElectronicAssetsExcelVO> convertList02(List<ElectronicAssetsDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 资产档案 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("ea_electronic_assets")
|
||||
@KeySequence("ea_electronic_assets_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ElectronicAssetsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 资产档案id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 业务实体id
|
||||
*/
|
||||
private Long companyId;
|
||||
/**
|
||||
* 业务实体名称
|
||||
*/
|
||||
private String company;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
/**
|
||||
* 资产编号
|
||||
*/
|
||||
private String assetCode;
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
private String assetName;
|
||||
/**
|
||||
* 资产描述
|
||||
*/
|
||||
private String assetDescription;
|
||||
/**
|
||||
* 资产类型
|
||||
*/
|
||||
private String assetType;
|
||||
/**
|
||||
* 购买日期
|
||||
*/
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
* 报废日期
|
||||
*/
|
||||
private LocalDateTime disposalDate;
|
||||
/**
|
||||
* 资产状态
|
||||
*/
|
||||
private String assetStatus;
|
||||
/**
|
||||
* 资产价格
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
/**
|
||||
* 资产数量
|
||||
*/
|
||||
private Integer assetQuantity;
|
||||
/**
|
||||
* 购买渠道
|
||||
*/
|
||||
private String purchaseChannel;
|
||||
/**
|
||||
* 文件来源
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
private String year;
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
private String period;
|
||||
/**
|
||||
* 借阅状态
|
||||
*/
|
||||
private String borrowStatus;
|
||||
/**
|
||||
* 纸档位置
|
||||
*/
|
||||
private String position;
|
||||
/**
|
||||
* 完整性
|
||||
*/
|
||||
private String cherks;
|
||||
/**
|
||||
* 归档id
|
||||
*/
|
||||
private Long recordId;
|
||||
/**
|
||||
* 归档状态
|
||||
*/
|
||||
private String fileStatus;
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.ea.dal.mysql.electronicassets;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo.*;
|
||||
|
||||
/**
|
||||
* 资产档案 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ElectronicAssetsMapper extends BaseMapperX<ElectronicAssetsDO> {
|
||||
|
||||
default PageResult<ElectronicAssetsDO> selectPage(ElectronicAssetsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicAssetsDO>()
|
||||
.eqIfPresent(ElectronicAssetsDO::getCompanyId, reqVO.getCompanyId())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCompany, reqVO.getCompany())
|
||||
.eqIfPresent(ElectronicAssetsDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(ElectronicAssetsDO::getDeptName, reqVO.getDeptName())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetCode, reqVO.getAssetCode())
|
||||
.likeIfPresent(ElectronicAssetsDO::getAssetName, reqVO.getAssetName())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetDescription, reqVO.getAssetDescription())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetType, reqVO.getAssetType())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getPurchaseDate, reqVO.getPurchaseDate())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getDisposalDate, reqVO.getDisposalDate())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetStatus, reqVO.getAssetStatus())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPurchasePrice, reqVO.getPurchasePrice())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetQuantity, reqVO.getAssetQuantity())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPurchaseChannel, reqVO.getPurchaseChannel())
|
||||
.eqIfPresent(ElectronicAssetsDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ElectronicAssetsDO::getYear, reqVO.getYear())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPeriod, reqVO.getPeriod())
|
||||
.eqIfPresent(ElectronicAssetsDO::getBorrowStatus, reqVO.getBorrowStatus())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCherks, reqVO.getCherks())
|
||||
.eqIfPresent(ElectronicAssetsDO::getRecordId, reqVO.getRecordId())
|
||||
.eqIfPresent(ElectronicAssetsDO::getFileStatus, reqVO.getFileStatus())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCreateBy, reqVO.getCreateBy())
|
||||
.orderByDesc(ElectronicAssetsDO::getId));
|
||||
}
|
||||
|
||||
default List<ElectronicAssetsDO> selectList(ElectronicAssetsExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ElectronicAssetsDO>()
|
||||
.eqIfPresent(ElectronicAssetsDO::getCompanyId, reqVO.getCompanyId())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCompany, reqVO.getCompany())
|
||||
.eqIfPresent(ElectronicAssetsDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(ElectronicAssetsDO::getDeptName, reqVO.getDeptName())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetCode, reqVO.getAssetCode())
|
||||
.likeIfPresent(ElectronicAssetsDO::getAssetName, reqVO.getAssetName())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetDescription, reqVO.getAssetDescription())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetType, reqVO.getAssetType())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getPurchaseDate, reqVO.getPurchaseDate())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getDisposalDate, reqVO.getDisposalDate())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetStatus, reqVO.getAssetStatus())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPurchasePrice, reqVO.getPurchasePrice())
|
||||
.eqIfPresent(ElectronicAssetsDO::getAssetQuantity, reqVO.getAssetQuantity())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPurchaseChannel, reqVO.getPurchaseChannel())
|
||||
.eqIfPresent(ElectronicAssetsDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ElectronicAssetsDO::getYear, reqVO.getYear())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPeriod, reqVO.getPeriod())
|
||||
.eqIfPresent(ElectronicAssetsDO::getBorrowStatus, reqVO.getBorrowStatus())
|
||||
.eqIfPresent(ElectronicAssetsDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCherks, reqVO.getCherks())
|
||||
.eqIfPresent(ElectronicAssetsDO::getRecordId, reqVO.getRecordId())
|
||||
.eqIfPresent(ElectronicAssetsDO::getFileStatus, reqVO.getFileStatus())
|
||||
.betweenIfPresent(ElectronicAssetsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ElectronicAssetsDO::getCreateBy, reqVO.getCreateBy())
|
||||
.orderByDesc(ElectronicAssetsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.ea.service.electronicassets;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo.*;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 资产档案 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ElectronicAssetsService {
|
||||
|
||||
/**
|
||||
* 创建资产档案
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createElectronicAssets(@Valid ElectronicAssetsCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新资产档案
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateElectronicAssets(@Valid ElectronicAssetsUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除资产档案
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteElectronicAssets(Long id);
|
||||
|
||||
/**
|
||||
* 获得资产档案
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 资产档案
|
||||
*/
|
||||
ElectronicAssetsDO getElectronicAssets(Long id);
|
||||
|
||||
/**
|
||||
* 获得资产档案列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 资产档案列表
|
||||
*/
|
||||
List<ElectronicAssetsDO> getElectronicAssetsList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得资产档案分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 资产档案分页
|
||||
*/
|
||||
PageResult<ElectronicAssetsDO> getElectronicAssetsPage(ElectronicAssetsPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得资产档案列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 资产档案列表
|
||||
*/
|
||||
List<ElectronicAssetsDO> getElectronicAssetsList(ElectronicAssetsExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package cn.iocoder.yudao.module.ea.service.electronicassets;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicassets.vo.*;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.ea.convert.electronicassets.ElectronicAssetsConvert;
|
||||
import cn.iocoder.yudao.module.ea.dal.mysql.electronicassets.ElectronicAssetsMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 资产档案 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ElectronicAssetsServiceImpl implements ElectronicAssetsService {
|
||||
|
||||
@Resource
|
||||
private ElectronicAssetsMapper electronicAssetsMapper;
|
||||
|
||||
@Override
|
||||
public Long createElectronicAssets(ElectronicAssetsCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
ElectronicAssetsDO electronicAssets = ElectronicAssetsConvert.INSTANCE.convert(createReqVO);
|
||||
electronicAssetsMapper.insert(electronicAssets);
|
||||
// 返回
|
||||
return electronicAssets.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateElectronicAssets(ElectronicAssetsUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateElectronicAssetsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ElectronicAssetsDO updateObj = ElectronicAssetsConvert.INSTANCE.convert(updateReqVO);
|
||||
electronicAssetsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteElectronicAssets(Long id) {
|
||||
// 校验存在
|
||||
validateElectronicAssetsExists(id);
|
||||
// 删除
|
||||
electronicAssetsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateElectronicAssetsExists(Long id) {
|
||||
if (electronicAssetsMapper.selectById(id) == null) {
|
||||
throw exception(ELECTRONIC_ASSETS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectronicAssetsDO getElectronicAssets(Long id) {
|
||||
return electronicAssetsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElectronicAssetsDO> getElectronicAssetsList(Collection<Long> ids) {
|
||||
return electronicAssetsMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ElectronicAssetsDO> getElectronicAssetsPage(ElectronicAssetsPageReqVO pageReqVO) {
|
||||
return electronicAssetsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElectronicAssetsDO> getElectronicAssetsList(ElectronicAssetsExportReqVO exportReqVO) {
|
||||
return electronicAssetsMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue