Merge remote-tracking branch 'origin/main'
commit
eac740208f
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.*;
|
||||
import cn.iocoder.yudao.module.ea.convert.electronicfinance.ElectronicFinanceConvert;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO;
|
||||
import cn.iocoder.yudao.module.ea.service.electronicfinance.ElectronicFinanceService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 财务档案")
|
||||
@RestController
|
||||
@RequestMapping("/electronic/finance")
|
||||
@Validated
|
||||
public class ElectronicFinanceController {
|
||||
|
||||
@Resource
|
||||
private ElectronicFinanceService financeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建财务档案")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:create')")
|
||||
public CommonResult<Long> createFinance(@Valid @RequestBody ElectronicFinanceCreateReqVO createReqVO) {
|
||||
return success(financeService.createFinance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新财务档案")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:update')")
|
||||
public CommonResult<Boolean> updateFinance(@Valid @RequestBody ElectronicFinanceUpdateReqVO updateReqVO) {
|
||||
financeService.updateFinance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除财务档案")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:delete')")
|
||||
public CommonResult<Boolean> deleteFinance(@RequestParam("id") Long[] id) {
|
||||
financeService.deleteFinance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得财务档案")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:query')")
|
||||
public CommonResult<ElectronicFinanceRespVO> getFinance(@RequestParam("id") Long id) {
|
||||
ElectronicFinanceDO finance = financeService.getFinance(id);
|
||||
return success(ElectronicFinanceConvert.INSTANCE.convert(finance));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得财务档案列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:query')")
|
||||
public CommonResult<List<ElectronicFinanceRespVO>> getFinanceList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ElectronicFinanceDO> list = financeService.getFinanceList(ids);
|
||||
return success(ElectronicFinanceConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得财务档案分页")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:query')")
|
||||
public CommonResult<PageResult<ElectronicFinanceRespVO>> getFinancePage(@Valid ElectronicFinancePageReqVO pageVO) {
|
||||
PageResult<ElectronicFinanceDO> pageResult = financeService.getFinancePage(pageVO);
|
||||
return success(ElectronicFinanceConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出财务档案 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('electronic:finance:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFinanceExcel(@Valid ElectronicFinanceExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ElectronicFinanceDO> list = financeService.getFinanceList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ElectronicFinanceExcelVO> datas = ElectronicFinanceConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "财务档案.xls", "数据", ElectronicFinanceExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
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 ElectronicFinanceCreateReqVO extends ElectronicFinanceBaseVO {
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
|
||||
/**
|
||||
* 财务档案 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicFinanceExcelVO {
|
||||
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("制单人")
|
||||
private String createBy;
|
||||
|
||||
@ExcelProperty("业务实体id")
|
||||
private Long companyId;
|
||||
|
||||
@ExcelProperty("业务实体")
|
||||
private String company;
|
||||
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty("所属部门id")
|
||||
private Long deptId;
|
||||
|
||||
@ExcelProperty("所属部门")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("支付账户")
|
||||
private String account;
|
||||
|
||||
@ExcelProperty("项目")
|
||||
private String project;
|
||||
|
||||
@ExcelProperty("收据/发票号码")
|
||||
private String invoiceNumber;
|
||||
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal price;
|
||||
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("contract_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private String status;
|
||||
|
||||
@ExcelProperty("纸档位置")
|
||||
private String position;
|
||||
|
||||
@ExcelProperty(value = "完整性", converter = DictConvert.class)
|
||||
@DictFormat("cherks") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private Integer cherks;
|
||||
|
||||
@ExcelProperty("归档id")
|
||||
private Long recordId;
|
||||
|
||||
@ExcelProperty(value = "交易类型", converter = DictConvert.class)
|
||||
@DictFormat("trade_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private String tradeType;
|
||||
|
||||
@ExcelProperty(value = "支付方式", converter = DictConvert.class)
|
||||
@DictFormat("pay_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private String payType;
|
||||
|
||||
@ExcelProperty(value = "归档状态", converter = DictConvert.class)
|
||||
@DictFormat("archives_file_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private String fileStatus;
|
||||
|
||||
@ExcelProperty("附件")
|
||||
private String contractAttachment;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remarks;
|
||||
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("交易日期")
|
||||
private LocalDateTime tradeDate;
|
||||
|
||||
@ExcelProperty("归档日期")
|
||||
private String recordTime;
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 ElectronicFinancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "制单人")
|
||||
private String createBy;
|
||||
|
||||
@Schema(description = "业务实体id", example = "17856")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "业务实体")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "用户id", example = "16066")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "所属部门id", example = "13607")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "所属部门", example = "芋艿")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "支付账户", example = "5498")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "项目")
|
||||
private String project;
|
||||
|
||||
@Schema(description = "收据/发票号码")
|
||||
private String invoiceNumber;
|
||||
|
||||
@Schema(description = "金额", example = "23497")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "纸档位置")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "完整性")
|
||||
private Integer cherks;
|
||||
|
||||
@Schema(description = "归档id")
|
||||
private Long recordId;
|
||||
|
||||
@Schema(description = "交易类型")
|
||||
private String tradeType;
|
||||
|
||||
@Schema(description = "支付方式")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "归档状态")
|
||||
private String fileStatus;
|
||||
|
||||
@ExcelProperty("附件")
|
||||
private String contractAttachment;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "交易日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] tradeDate;
|
||||
|
||||
@Schema(description = "归档日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] recordTime;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
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 = "管理后台 - 财务档案 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ElectronicFinanceRespVO extends ElectronicFinanceBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6066")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.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 ElectronicFinanceUpdateReqVO extends ElectronicFinanceBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6066")
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.ea.convert.electronicfinance;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExcelVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceRespVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 财务档案 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ElectronicFinanceConvert {
|
||||
|
||||
ElectronicFinanceConvert INSTANCE = Mappers.getMapper(ElectronicFinanceConvert.class);
|
||||
|
||||
ElectronicFinanceDO convert(ElectronicFinanceCreateReqVO bean);
|
||||
|
||||
ElectronicFinanceDO convert(ElectronicFinanceUpdateReqVO bean);
|
||||
|
||||
ElectronicFinanceRespVO convert(ElectronicFinanceDO bean);
|
||||
|
||||
List<ElectronicFinanceRespVO> convertList(List<ElectronicFinanceDO> list);
|
||||
|
||||
PageResult<ElectronicFinanceRespVO> convertPage(PageResult<ElectronicFinanceDO> page);
|
||||
|
||||
List<ElectronicFinanceExcelVO> convertList02(List<ElectronicFinanceDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
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("electronic_finance")
|
||||
@KeySequence("electronic_finance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ElectronicFinanceDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 业务实体id
|
||||
*/
|
||||
private Long companyId;
|
||||
/**
|
||||
* 业务实体
|
||||
*/
|
||||
private String company;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
private String deptName;
|
||||
/**
|
||||
* 支付账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
private String project;
|
||||
/**
|
||||
* 收据/发票号码
|
||||
*/
|
||||
private String invoiceNumber;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 枚举
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 纸档位置
|
||||
*/
|
||||
private String position;
|
||||
/**
|
||||
* 完整性
|
||||
*
|
||||
* 枚举
|
||||
*/
|
||||
private Integer cherks;
|
||||
/**
|
||||
* 归档id
|
||||
*/
|
||||
private Long recordId;
|
||||
/**
|
||||
* 交易类型
|
||||
*
|
||||
* 枚举
|
||||
*/
|
||||
private String tradeType;
|
||||
/**
|
||||
* 支付方式
|
||||
*
|
||||
* 枚举
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 归档状态
|
||||
*
|
||||
* 枚举
|
||||
*/
|
||||
private String fileStatus;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 交易日期
|
||||
*/
|
||||
private LocalDateTime tradeDate;
|
||||
/**
|
||||
* 归档日期
|
||||
*/
|
||||
private String recordTime;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String contractAttachment;
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 财务档案 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ElectronicFinanceMapper extends BaseMapperX<ElectronicFinanceDO> {
|
||||
|
||||
default PageResult<ElectronicFinanceDO> selectPage(ElectronicFinancePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicFinanceDO>()
|
||||
.eqIfPresent(ElectronicFinanceDO::getCreateBy, reqVO.getCreateBy())
|
||||
.eqIfPresent(ElectronicFinanceDO::getCompanyId, reqVO.getCompanyId())
|
||||
.likeIfPresent(ElectronicFinanceDO::getCompany, reqVO.getCompany())
|
||||
.eqIfPresent(ElectronicFinanceDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(ElectronicFinanceDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(ElectronicFinanceDO::getDeptName, reqVO.getDeptName())
|
||||
.likeIfPresent(ElectronicFinanceDO::getAccount, reqVO.getAccount())
|
||||
.likeIfPresent(ElectronicFinanceDO::getProject, reqVO.getProject())
|
||||
.likeIfPresent(ElectronicFinanceDO::getInvoiceNumber, reqVO.getInvoiceNumber())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ElectronicFinanceDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(ElectronicFinanceDO::getCherks, reqVO.getCherks())
|
||||
.eqIfPresent(ElectronicFinanceDO::getRecordId, reqVO.getRecordId())
|
||||
.eqIfPresent(ElectronicFinanceDO::getTradeType, reqVO.getTradeType())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPayType, reqVO.getPayType())
|
||||
.eqIfPresent(ElectronicFinanceDO::getFileStatus, reqVO.getFileStatus())
|
||||
.eqIfPresent(ElectronicFinanceDO::getRemarks, reqVO.getRemarks())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getTradeDate, reqVO.getTradeDate())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getRecordTime, reqVO.getRecordTime())
|
||||
.orderByDesc(ElectronicFinanceDO::getId));
|
||||
}
|
||||
|
||||
default List<ElectronicFinanceDO> selectList(ElectronicFinanceExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ElectronicFinanceDO>()
|
||||
.eqIfPresent(ElectronicFinanceDO::getCreateBy, reqVO.getCreateBy())
|
||||
.eqIfPresent(ElectronicFinanceDO::getCompanyId, reqVO.getCompanyId())
|
||||
.likeIfPresent(ElectronicFinanceDO::getCompany, reqVO.getCompany())
|
||||
.eqIfPresent(ElectronicFinanceDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(ElectronicFinanceDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(ElectronicFinanceDO::getDeptName, reqVO.getDeptName())
|
||||
.likeIfPresent(ElectronicFinanceDO::getAccount, reqVO.getAccount())
|
||||
.likeIfPresent(ElectronicFinanceDO::getProject, reqVO.getProject())
|
||||
.likeIfPresent(ElectronicFinanceDO::getInvoiceNumber, reqVO.getInvoiceNumber())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ElectronicFinanceDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(ElectronicFinanceDO::getCherks, reqVO.getCherks())
|
||||
.eqIfPresent(ElectronicFinanceDO::getRecordId, reqVO.getRecordId())
|
||||
.eqIfPresent(ElectronicFinanceDO::getTradeType, reqVO.getTradeType())
|
||||
.eqIfPresent(ElectronicFinanceDO::getPayType, reqVO.getPayType())
|
||||
.eqIfPresent(ElectronicFinanceDO::getFileStatus, reqVO.getFileStatus())
|
||||
.eqIfPresent(ElectronicFinanceDO::getRemarks, reqVO.getRemarks())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getTradeDate, reqVO.getTradeDate())
|
||||
.betweenIfPresent(ElectronicFinanceDO::getRecordTime, reqVO.getRecordTime())
|
||||
.orderByDesc(ElectronicFinanceDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.ea.service.electronicfinance;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 财务档案 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ElectronicFinanceService {
|
||||
|
||||
/**
|
||||
* 创建财务档案
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFinance(@Valid ElectronicFinanceCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新财务档案
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFinance(@Valid ElectronicFinanceUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除财务档案
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFinance(Long[] id);
|
||||
|
||||
/**
|
||||
* 获得财务档案
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 财务档案
|
||||
*/
|
||||
ElectronicFinanceDO getFinance(Long id);
|
||||
|
||||
/**
|
||||
* 获得财务档案列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 财务档案列表
|
||||
*/
|
||||
List<ElectronicFinanceDO> getFinanceList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得财务档案分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 财务档案分页
|
||||
*/
|
||||
PageResult<ElectronicFinanceDO> getFinancePage(ElectronicFinancePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得财务档案列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 财务档案列表
|
||||
*/
|
||||
List<ElectronicFinanceDO> getFinanceList(ElectronicFinanceExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.ea.service.electronicfinance;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO;
|
||||
import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.ea.convert.electronicfinance.ElectronicFinanceConvert;
|
||||
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO;
|
||||
import cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance.ElectronicFinanceMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.FINANCE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 财务档案 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ElectronicFinanceServiceImpl implements ElectronicFinanceService {
|
||||
|
||||
@Resource
|
||||
private ElectronicFinanceMapper financeMapper;
|
||||
|
||||
@Override
|
||||
public Long createFinance(ElectronicFinanceCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
ElectronicFinanceDO finance = ElectronicFinanceConvert.INSTANCE.convert(createReqVO);
|
||||
financeMapper.insert(finance);
|
||||
// 返回
|
||||
return finance.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFinance(ElectronicFinanceUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFinanceExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ElectronicFinanceDO updateObj = ElectronicFinanceConvert.INSTANCE.convert(updateReqVO);
|
||||
financeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFinance(Long[] id) {
|
||||
// 删除
|
||||
financeMapper.deleteBatchIds(Arrays.asList(id));
|
||||
}
|
||||
|
||||
private void validateFinanceExists(Long id) {
|
||||
if (financeMapper.selectById(id) == null) {
|
||||
throw exception(FINANCE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectronicFinanceDO getFinance(Long id) {
|
||||
return financeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElectronicFinanceDO> getFinanceList(Collection<Long> ids) {
|
||||
return financeMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ElectronicFinanceDO> getFinancePage(ElectronicFinancePageReqVO pageReqVO) {
|
||||
return financeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElectronicFinanceDO> getFinanceList(ElectronicFinanceExportReqVO exportReqVO) {
|
||||
return financeMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package cn.iocoder.yudao.module.ea.utils.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* author: zk
|
||||
* date: 2023/9/22
|
||||
* description: 借阅状态枚举
|
||||
* @author HP
|
||||
*/
|
||||
@Getter
|
||||
public enum BorrowStatusEnum {
|
||||
/**
|
||||
* 借阅状态枚举
|
||||
*/
|
||||
BORROWSTATUS_TRUE("true", "1"),
|
||||
BORROWSTATUS_FALSE("false", "0")
|
||||
;
|
||||
|
||||
@JsonValue
|
||||
private final String status;
|
||||
|
||||
/**
|
||||
* 获取转换后的状态
|
||||
*/
|
||||
@EnumValue
|
||||
private final String isStatus;
|
||||
|
||||
BorrowStatusEnum(String status, String isStatus) {
|
||||
this.status = status;
|
||||
this.isStatus = isStatus;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue