银行回单

new
parent 9cca34a28c
commit f31904729f

@ -12,4 +12,7 @@ public interface ErrorCodeConstants {
ErrorCode AUTHENTICATE_NOT_EXISTS = new ErrorCode(300300,"档案鉴定历史不存在"); ErrorCode AUTHENTICATE_NOT_EXISTS = new ErrorCode(300300,"档案鉴定历史不存在");
ErrorCode FLOW_NOT_EXISTS = new ErrorCode(300400, "审批流程不存在"); ErrorCode FLOW_NOT_EXISTS = new ErrorCode(300400, "审批流程不存在");
ErrorCode BANK_SLIP_NOT_EXISTS = new ErrorCode(400500, "银行回单不存在");
} }

@ -102,6 +102,12 @@
<version>1.7.3-snapshot</version> <version>1.7.3-snapshot</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-setting-biz</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -0,0 +1,125 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip;
import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService;
import com.alibaba.fastjson.JSONObject;
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.archives.controller.admin.bankslip.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.bankslip.BankSlipDO;
import cn.iocoder.yudao.module.archives.convert.bankslip.BankSlipConvert;
import cn.iocoder.yudao.module.archives.service.bankslip.BankSlipService;
@Tag(name = "管理后台 - 银行回单")
@RestController
@RequestMapping("/archives/bank-slip")
@Validated
public class BankSlipController {
@Resource
private BankSlipService bankSlipService;
@Resource
private PasswordsService passwordsService;
@PostMapping("/create")
@Operation(summary = "创建银行回单")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:create')")
public CommonResult<Long> createBankSlip(@Valid @RequestBody BankSlipCreateReqVO createReqVO) {
return success(bankSlipService.createBankSlip(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新银行回单")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:update')")
public CommonResult<Boolean> updateBankSlip(@Valid @RequestBody BankSlipUpdateReqVO updateReqVO) {
bankSlipService.updateBankSlip(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除银行回单")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:bank-slip:delete')")
public CommonResult<Boolean> deleteBankSlip(@RequestParam("id") Long id) {
bankSlipService.deleteBankSlip(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得银行回单")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:query')")
public CommonResult<BankSlipRespVO> getBankSlip(@RequestParam("id") Long id) {
BankSlipDO bankSlip = bankSlipService.getBankSlip(id);
return success(BankSlipConvert.INSTANCE.convert(bankSlip));
}
@GetMapping("/list")
@Operation(summary = "获得银行回单列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:query')")
public CommonResult<List<BankSlipRespVO>> getBankSlipList(@RequestParam("ids") Collection<Long> ids) {
List<BankSlipDO> list = bankSlipService.getBankSlipList(ids);
return success(BankSlipConvert.INSTANCE.convertList(list));
}
@GetMapping("/pageTime")
@Operation(summary = "根据时间段获得发票分页")
@PreAuthorize("@ss.hasPermission('accounting:invoices:query')")
public CommonResult<PageResult<BankSlipRespVO>> getBankSlipPageTime(Long months) {
PageResult<BankSlipDO> pageResult = bankSlipService.getBankSlipPageTime(months);
return success(BankSlipConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/downloadXml")
@Operation(summary = "获得银行回单分页Xml")
@PreAuthorize("@ss.hasPermission('accounting:invoices:query')")
public void downloadXml(@Valid BankSlipPageReqVO pageVO,HttpServletResponse response) throws IOException {
PageResult<BankSlipDO> pageResult = bankSlipService.getBankSlipPage(pageVO);
PageResult<BankSlipRespVO> invoicesRespVOPageResult = BankSlipConvert.INSTANCE.convertPage(pageResult);
String jsonString = JSONObject.toJSONString(invoicesRespVOPageResult);
passwordsService.jsonToXmlConverter(response,pageVO.getInputPassword(),jsonString);
}
@GetMapping("/page")
@Operation(summary = "获得银行回单分页")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:query')")
public CommonResult<PageResult<BankSlipRespVO>> getBankSlipPage(@Valid BankSlipPageReqVO pageVO) {
PageResult<BankSlipDO> pageResult = bankSlipService.getBankSlipPage(pageVO);
return success(BankSlipConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出银行回单 Excel")
@PreAuthorize("@ss.hasPermission('archives:bank-slip:export')")
@OperateLog(type = EXPORT)
public void exportBankSlipExcel(@Valid BankSlipExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<BankSlipDO> list = bankSlipService.getBankSlipList(exportReqVO);
// 导出 Excel
List<BankSlipExcelVO> datas = BankSlipConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "银行回单.xls", "数据", BankSlipExcelVO.class, datas);
}
}

@ -0,0 +1,143 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class BankSlipBaseVO {
@Schema(description = "凭证id", example = "12880")
private Long voucherId;
@Schema(description = "OA/ERP流程编号")
private String flowCode;
@Schema(description = "交易日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime tradTime;
@Schema(description = "银行")
private String bank;
@Schema(description = "交易类型", example = "1")
private String type;
@Schema(description = "我方账户")
private String myCompany;
@Schema(description = "我方账号")
private String myNum;
@Schema(description = "对方账户")
private String adverseCompany;
@Schema(description = "对方账号")
private String adverseNum;
@Schema(description = "业务实体id", example = "3665")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门id", example = "14703")
private Long deptId;
@Schema(description = "所属部门")
private String dept;
@Schema(description = "借/贷")
private String debitOrCredit;
@Schema(description = "币种")
private String currency;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "交易流水号")
private String serialNum;
@Schema(description = "借方金额")
private String debitMoney;
@Schema(description = "交易金额")
private String tradMoney;
@Schema(description = "贷方金额")
private String creditMoney;
@Schema(description = "余额")
private String balance;
@Schema(description = "业务单号")
private String busNum;
@Schema(description = "回单编号")
private String receiptNum;
@Schema(description = "摘要")
private String digest;
@Schema(description = "扩展摘要")
private String digestExtend;
@Schema(description = "业务摘要")
private String businessDigest;
@Schema(description = "其他摘要")
private String theOther;
@Schema(description = "用途")
private String purpose;
@Schema(description = "业务编号")
private String businessNum;
@Schema(description = "业务名称", example = "赵六")
private String businessName;
@Schema(description = "票据号")
private String billNum;
@Schema(description = "商务支付订单号")
private String businessOrder;
@Schema(description = "企业识别码")
private String headingCode;
@Schema(description = "对方银行码")
private String bankCode;
@Schema(description = "对方开户地址")
private String bankSite;
@Schema(description = "对方开户地区")
private String bankRegion;
@Schema(description = "加密")
private String encrypt;
@Schema(description = "归档id", example = "21361")
private Long archiveId;
@Schema(description = "归档状态")
private String archiveState;
@Schema(description = "密码")
private String password;
}

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.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 BankSlipCreateReqVO extends BankSlipBaseVO {
}

@ -0,0 +1,147 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class BankSlipExcelVO {
@ExcelProperty("id")
private Long id;
@ExcelProperty("凭证id")
private Long voucherId;
@ExcelProperty("OA/ERP流程编号")
private String flowCode;
@ExcelProperty("交易日期")
private LocalDateTime tradTime;
@ExcelProperty("银行")
private String bank;
@ExcelProperty("交易类型")
private String type;
@ExcelProperty("我方账户")
private String myCompany;
@ExcelProperty("我方账号")
private String myNum;
@ExcelProperty("对方账户")
private String adverseCompany;
@ExcelProperty("对方账号")
private String adverseNum;
@ExcelProperty("业务实体id")
private Long companyId;
@ExcelProperty("业务实体")
private String company;
@ExcelProperty("所属部门id")
private Long deptId;
@ExcelProperty("所属部门")
private String dept;
@ExcelProperty("借/贷")
private String debitOrCredit;
@ExcelProperty("币种")
private String currency;
@ExcelProperty("状态")
private String status;
@ExcelProperty("交易流水号")
private String serialNum;
@ExcelProperty("借方金额")
private String debitMoney;
@ExcelProperty("交易金额")
private String tradMoney;
@ExcelProperty("贷方金额")
private String creditMoney;
@ExcelProperty("余额")
private String balance;
@ExcelProperty("业务单号")
private String busNum;
@ExcelProperty("回单编号")
private String receiptNum;
@ExcelProperty("摘要")
private String digest;
@ExcelProperty("扩展摘要")
private String digestExtend;
@ExcelProperty("业务摘要")
private String businessDigest;
@ExcelProperty("其他摘要")
private String theOther;
@ExcelProperty("用途")
private String purpose;
@ExcelProperty("业务编号")
private String businessNum;
@ExcelProperty("业务名称")
private String businessName;
@ExcelProperty("票据号")
private String billNum;
@ExcelProperty("商务支付订单号")
private String businessOrder;
@ExcelProperty("企业识别码")
private String headingCode;
@ExcelProperty("对方银行码")
private String bankCode;
@ExcelProperty("对方开户地址")
private String bankSite;
@ExcelProperty("对方开户地区")
private String bankRegion;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("加密")
private String encrypt;
@ExcelProperty("归档id")
private Long archiveId;
@ExcelProperty("归档状态")
private String archiveState;
@ExcelProperty("密码")
private String password;
}

@ -0,0 +1,141 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 银行回单 Excel 导出 Request VO参数和 BankSlipPageReqVO 是一致的")
@Data
public class BankSlipExportReqVO {
@Schema(description = "凭证id", example = "12880")
private Long voucherId;
@Schema(description = "OA/ERP流程编号")
private String flowCode;
@Schema(description = "交易日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] tradTime;
@Schema(description = "银行")
private String bank;
@Schema(description = "交易类型", example = "1")
private String type;
@Schema(description = "我方账户")
private String myCompany;
@Schema(description = "我方账号")
private String myNum;
@Schema(description = "对方账户")
private String adverseCompany;
@Schema(description = "对方账号")
private String adverseNum;
@Schema(description = "业务实体id", example = "3665")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门id", example = "14703")
private Long deptId;
@Schema(description = "所属部门")
private String dept;
@Schema(description = "借/贷")
private String debitOrCredit;
@Schema(description = "币种")
private String currency;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "交易流水号")
private String serialNum;
@Schema(description = "借方金额")
private String debitMoney;
@Schema(description = "交易金额")
private String tradMoney;
@Schema(description = "贷方金额")
private String creditMoney;
@Schema(description = "余额")
private String balance;
@Schema(description = "业务单号")
private String busNum;
@Schema(description = "回单编号")
private String receiptNum;
@Schema(description = "摘要")
private String digest;
@Schema(description = "扩展摘要")
private String digestExtend;
@Schema(description = "业务摘要")
private String businessDigest;
@Schema(description = "其他摘要")
private String theOther;
@Schema(description = "用途")
private String purpose;
@Schema(description = "业务编号")
private String businessNum;
@Schema(description = "业务名称", example = "赵六")
private String businessName;
@Schema(description = "票据号")
private String billNum;
@Schema(description = "商务支付订单号")
private String businessOrder;
@Schema(description = "企业识别码")
private String headingCode;
@Schema(description = "对方银行码")
private String bankCode;
@Schema(description = "对方开户地址")
private String bankSite;
@Schema(description = "对方开户地区")
private String bankRegion;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "加密")
private String encrypt;
@Schema(description = "归档id", example = "21361")
private Long archiveId;
@Schema(description = "归档状态")
private String archiveState;
@Schema(description = "密码")
private String password;
}

@ -0,0 +1,143 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo;
import lombok.*;
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 BankSlipPageReqVO extends PageParam {
@Schema(description = "凭证id", example = "12880")
private Long voucherId;
@Schema(description = "OA/ERP流程编号")
private String flowCode;
@Schema(description = "交易日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] tradTime;
@Schema(description = "银行")
private String bank;
@Schema(description = "交易类型", example = "1")
private String type;
@Schema(description = "我方账户")
private String myCompany;
@Schema(description = "我方账号")
private String myNum;
@Schema(description = "对方账户")
private String adverseCompany;
@Schema(description = "对方账号")
private String adverseNum;
@Schema(description = "业务实体id", example = "3665")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门id", example = "14703")
private Long deptId;
@Schema(description = "所属部门")
private String dept;
@Schema(description = "借/贷")
private String debitOrCredit;
@Schema(description = "币种")
private String currency;
@Schema(description = "状态", example = "2")
private String status;
@Schema(description = "交易流水号")
private String serialNum;
@Schema(description = "借方金额")
private String debitMoney;
@Schema(description = "交易金额")
private String tradMoney;
@Schema(description = "贷方金额")
private String creditMoney;
@Schema(description = "余额")
private String balance;
@Schema(description = "业务单号")
private String busNum;
@Schema(description = "回单编号")
private String receiptNum;
@Schema(description = "摘要")
private String digest;
@Schema(description = "扩展摘要")
private String digestExtend;
@Schema(description = "业务摘要")
private String businessDigest;
@Schema(description = "其他摘要")
private String theOther;
@Schema(description = "用途")
private String purpose;
@Schema(description = "业务编号")
private String businessNum;
@Schema(description = "业务名称", example = "赵六")
private String businessName;
@Schema(description = "票据号")
private String billNum;
@Schema(description = "商务支付订单号")
private String businessOrder;
@Schema(description = "企业识别码")
private String headingCode;
@Schema(description = "对方银行码")
private String bankCode;
@Schema(description = "对方开户地址")
private String bankSite;
@Schema(description = "对方开户地区")
private String bankRegion;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "加密")
private String encrypt;
@Schema(description = "归档id", example = "21361")
private Long archiveId;
@Schema(description = "归档状态")
private String archiveState;
@Schema(description = "密码")
private String inputPassword;
}

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.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 BankSlipRespVO extends BankSlipBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15251")
private Long id;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.archives.controller.admin.bankslip.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 BankSlipUpdateReqVO extends BankSlipBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15251")
@NotNull(message = "id不能为空")
private Long id;
}

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.archives.convert.bankslip;
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.archives.controller.admin.bankslip.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.bankslip.BankSlipDO;
/**
* Convert
*
* @author
*/
@Mapper
public interface BankSlipConvert {
BankSlipConvert INSTANCE = Mappers.getMapper(BankSlipConvert.class);
BankSlipDO convert(BankSlipCreateReqVO bean);
BankSlipDO convert(BankSlipUpdateReqVO bean);
BankSlipRespVO convert(BankSlipDO bean);
List<BankSlipRespVO> convertList(List<BankSlipDO> list);
PageResult<BankSlipRespVO> convertPage(PageResult<BankSlipDO> page);
List<BankSlipExcelVO> convertList02(List<BankSlipDO> list);
}

@ -0,0 +1,193 @@
package cn.iocoder.yudao.module.archives.dal.dataobject.bankslip;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
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("archives_bank_slip")
@KeySequence("archives_bank_slip_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BankSlipDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long voucherId;
/**
* OA/ERP
*/
private String flowCode;
/**
*
*/
private LocalDateTime tradTime;
/**
*
*/
private String bank;
/**
*
*/
private String type;
/**
*
*/
private String myCompany;
/**
*
*/
private String myNum;
/**
*
*/
private String adverseCompany;
/**
*
*/
private String adverseNum;
/**
* id
*/
private Long companyId;
/**
*
*/
private String company;
/**
* id
*/
private Long deptId;
/**
*
*/
private String dept;
/**
* /
*/
private String debitOrCredit;
/**
*
*/
private String currency;
/**
*
*/
private String status;
/**
*
*/
private String serialNum;
/**
*
*/
private String debitMoney;
/**
*
*/
private String tradMoney;
/**
*
*/
private String creditMoney;
/**
*
*/
private String balance;
/**
*
*/
private String busNum;
/**
*
*/
private String receiptNum;
/**
*
*/
private String digest;
/**
*
*/
private String digestExtend;
/**
*
*/
private String businessDigest;
/**
*
*/
private String theOther;
/**
*
*/
private String purpose;
/**
*
*/
private String businessNum;
/**
*
*/
private String businessName;
/**
*
*/
private String billNum;
/**
*
*/
private String businessOrder;
/**
*
*/
private String headingCode;
/**
*
*/
private String bankCode;
/**
*
*/
private String bankSite;
/**
*
*/
private String bankRegion;
/**
*
*/
private String encrypt;
/**
* id
*/
private Long archiveId;
/**
*
*/
private String archiveState;
/**
*
*/
private String password;
}

@ -0,0 +1,112 @@
package cn.iocoder.yudao.module.archives.dal.mysql.bankslip;
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.archives.dal.dataobject.bankslip.BankSlipDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface BankSlipMapper extends BaseMapperX<BankSlipDO> {
default PageResult<BankSlipDO> selectPage(BankSlipPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BankSlipDO>()
.eqIfPresent(BankSlipDO::getVoucherId, reqVO.getVoucherId())
.eqIfPresent(BankSlipDO::getFlowCode, reqVO.getFlowCode())
.betweenIfPresent(BankSlipDO::getTradTime, reqVO.getTradTime())
.eqIfPresent(BankSlipDO::getBank, reqVO.getBank())
.eqIfPresent(BankSlipDO::getType, reqVO.getType())
.eqIfPresent(BankSlipDO::getMyCompany, reqVO.getMyCompany())
.eqIfPresent(BankSlipDO::getMyNum, reqVO.getMyNum())
.eqIfPresent(BankSlipDO::getAdverseCompany, reqVO.getAdverseCompany())
.eqIfPresent(BankSlipDO::getAdverseNum, reqVO.getAdverseNum())
.eqIfPresent(BankSlipDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(BankSlipDO::getCompany, reqVO.getCompany())
.eqIfPresent(BankSlipDO::getDeptId, reqVO.getDeptId())
.eqIfPresent(BankSlipDO::getDept, reqVO.getDept())
.eqIfPresent(BankSlipDO::getDebitOrCredit, reqVO.getDebitOrCredit())
.eqIfPresent(BankSlipDO::getCurrency, reqVO.getCurrency())
.eqIfPresent(BankSlipDO::getStatus, reqVO.getStatus())
.eqIfPresent(BankSlipDO::getSerialNum, reqVO.getSerialNum())
.eqIfPresent(BankSlipDO::getDebitMoney, reqVO.getDebitMoney())
.eqIfPresent(BankSlipDO::getTradMoney, reqVO.getTradMoney())
.eqIfPresent(BankSlipDO::getCreditMoney, reqVO.getCreditMoney())
.eqIfPresent(BankSlipDO::getBalance, reqVO.getBalance())
.eqIfPresent(BankSlipDO::getBusNum, reqVO.getBusNum())
.eqIfPresent(BankSlipDO::getReceiptNum, reqVO.getReceiptNum())
.eqIfPresent(BankSlipDO::getDigest, reqVO.getDigest())
.eqIfPresent(BankSlipDO::getDigestExtend, reqVO.getDigestExtend())
.eqIfPresent(BankSlipDO::getBusinessDigest, reqVO.getBusinessDigest())
.eqIfPresent(BankSlipDO::getTheOther, reqVO.getTheOther())
.eqIfPresent(BankSlipDO::getPurpose, reqVO.getPurpose())
.eqIfPresent(BankSlipDO::getBusinessNum, reqVO.getBusinessNum())
.likeIfPresent(BankSlipDO::getBusinessName, reqVO.getBusinessName())
.eqIfPresent(BankSlipDO::getBillNum, reqVO.getBillNum())
.eqIfPresent(BankSlipDO::getBusinessOrder, reqVO.getBusinessOrder())
.eqIfPresent(BankSlipDO::getHeadingCode, reqVO.getHeadingCode())
.eqIfPresent(BankSlipDO::getBankCode, reqVO.getBankCode())
.eqIfPresent(BankSlipDO::getBankSite, reqVO.getBankSite())
.eqIfPresent(BankSlipDO::getBankRegion, reqVO.getBankRegion())
.betweenIfPresent(BankSlipDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BankSlipDO::getEncrypt, reqVO.getEncrypt())
.eqIfPresent(BankSlipDO::getArchiveId, reqVO.getArchiveId())
.eqIfPresent(BankSlipDO::getArchiveState, reqVO.getArchiveState())
.eqIfPresent(BankSlipDO::getPassword, reqVO.getInputPassword())
.orderByDesc(BankSlipDO::getId));
}
default List<BankSlipDO> selectList(BankSlipExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<BankSlipDO>()
.eqIfPresent(BankSlipDO::getVoucherId, reqVO.getVoucherId())
.eqIfPresent(BankSlipDO::getFlowCode, reqVO.getFlowCode())
.betweenIfPresent(BankSlipDO::getTradTime, reqVO.getTradTime())
.eqIfPresent(BankSlipDO::getBank, reqVO.getBank())
.eqIfPresent(BankSlipDO::getType, reqVO.getType())
.eqIfPresent(BankSlipDO::getMyCompany, reqVO.getMyCompany())
.eqIfPresent(BankSlipDO::getMyNum, reqVO.getMyNum())
.eqIfPresent(BankSlipDO::getAdverseCompany, reqVO.getAdverseCompany())
.eqIfPresent(BankSlipDO::getAdverseNum, reqVO.getAdverseNum())
.eqIfPresent(BankSlipDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(BankSlipDO::getCompany, reqVO.getCompany())
.eqIfPresent(BankSlipDO::getDeptId, reqVO.getDeptId())
.eqIfPresent(BankSlipDO::getDept, reqVO.getDept())
.eqIfPresent(BankSlipDO::getDebitOrCredit, reqVO.getDebitOrCredit())
.eqIfPresent(BankSlipDO::getCurrency, reqVO.getCurrency())
.eqIfPresent(BankSlipDO::getStatus, reqVO.getStatus())
.eqIfPresent(BankSlipDO::getSerialNum, reqVO.getSerialNum())
.eqIfPresent(BankSlipDO::getDebitMoney, reqVO.getDebitMoney())
.eqIfPresent(BankSlipDO::getTradMoney, reqVO.getTradMoney())
.eqIfPresent(BankSlipDO::getCreditMoney, reqVO.getCreditMoney())
.eqIfPresent(BankSlipDO::getBalance, reqVO.getBalance())
.eqIfPresent(BankSlipDO::getBusNum, reqVO.getBusNum())
.eqIfPresent(BankSlipDO::getReceiptNum, reqVO.getReceiptNum())
.eqIfPresent(BankSlipDO::getDigest, reqVO.getDigest())
.eqIfPresent(BankSlipDO::getDigestExtend, reqVO.getDigestExtend())
.eqIfPresent(BankSlipDO::getBusinessDigest, reqVO.getBusinessDigest())
.eqIfPresent(BankSlipDO::getTheOther, reqVO.getTheOther())
.eqIfPresent(BankSlipDO::getPurpose, reqVO.getPurpose())
.eqIfPresent(BankSlipDO::getBusinessNum, reqVO.getBusinessNum())
.likeIfPresent(BankSlipDO::getBusinessName, reqVO.getBusinessName())
.eqIfPresent(BankSlipDO::getBillNum, reqVO.getBillNum())
.eqIfPresent(BankSlipDO::getBusinessOrder, reqVO.getBusinessOrder())
.eqIfPresent(BankSlipDO::getHeadingCode, reqVO.getHeadingCode())
.eqIfPresent(BankSlipDO::getBankCode, reqVO.getBankCode())
.eqIfPresent(BankSlipDO::getBankSite, reqVO.getBankSite())
.eqIfPresent(BankSlipDO::getBankRegion, reqVO.getBankRegion())
.betweenIfPresent(BankSlipDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BankSlipDO::getEncrypt, reqVO.getEncrypt())
.eqIfPresent(BankSlipDO::getArchiveId, reqVO.getArchiveId())
.eqIfPresent(BankSlipDO::getArchiveState, reqVO.getArchiveState())
.eqIfPresent(BankSlipDO::getPassword, reqVO.getPassword())
.orderByDesc(BankSlipDO::getId));
}
}

@ -0,0 +1,77 @@
package cn.iocoder.yudao.module.archives.service.bankslip;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.bankslip.BankSlipDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface BankSlipService {
/**
*
*
* @param createReqVO
* @return
*/
Long createBankSlip(@Valid BankSlipCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateBankSlip(@Valid BankSlipUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteBankSlip(Long id);
/**
*
*
* @param id
* @return
*/
BankSlipDO getBankSlip(Long id);
/**
*
*
* @param ids
* @return
*/
List<BankSlipDO> getBankSlipList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<BankSlipDO> getBankSlipPage(BankSlipPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<BankSlipDO> getBankSlipList(BankSlipExportReqVO exportReqVO);
/**
*
*
* @param months
* @return
*/
PageResult<BankSlipDO> getBankSlipPageTime(Long months);
}

@ -0,0 +1,101 @@
package cn.iocoder.yudao.module.archives.service.bankslip;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime;
import java.util.*;
import cn.iocoder.yudao.module.archives.controller.admin.bankslip.vo.*;
import cn.iocoder.yudao.module.archives.dal.dataobject.bankslip.BankSlipDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.archives.convert.bankslip.BankSlipConvert;
import cn.iocoder.yudao.module.archives.dal.mysql.bankslip.BankSlipMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class BankSlipServiceImpl implements BankSlipService {
@Resource
private BankSlipMapper bankSlipMapper;
@Override
public Long createBankSlip(BankSlipCreateReqVO createReqVO) {
// 插入
BankSlipDO bankSlip = BankSlipConvert.INSTANCE.convert(createReqVO);
bankSlipMapper.insert(bankSlip);
// 返回
return bankSlip.getId();
}
@Override
public void updateBankSlip(BankSlipUpdateReqVO updateReqVO) {
// 校验存在
validateBankSlipExists(updateReqVO.getId());
// 更新
BankSlipDO updateObj = BankSlipConvert.INSTANCE.convert(updateReqVO);
bankSlipMapper.updateById(updateObj);
}
@Override
public void deleteBankSlip(Long id) {
// 校验存在
validateBankSlipExists(id);
// 删除
bankSlipMapper.deleteById(id);
}
private void validateBankSlipExists(Long id) {
if (bankSlipMapper.selectById(id) == null) {
throw exception(BANK_SLIP_NOT_EXISTS);
}
}
@Override
public BankSlipDO getBankSlip(Long id) {
return bankSlipMapper.selectById(id);
}
@Override
public List<BankSlipDO> getBankSlipList(Collection<Long> ids) {
return bankSlipMapper.selectBatchIds(ids);
}
@Override
public PageResult<BankSlipDO> getBankSlipPage(BankSlipPageReqVO pageReqVO) {
return bankSlipMapper.selectPage(pageReqVO);
}
@Override
public List<BankSlipDO> getBankSlipList(BankSlipExportReqVO exportReqVO) {
return bankSlipMapper.selectList(exportReqVO);
}
/**
*
*
* @param months
* @return
*/
@Override
public PageResult<BankSlipDO> getBankSlipPageTime(Long months) {
QueryWrapper<BankSlipDO> wrapper = new QueryWrapper<>();
wrapper.ge("trad_time", LocalDateTime.now().minusMonths(months));
List<BankSlipDO> invoicesDOS = bankSlipMapper.selectList(wrapper);
PageResult<BankSlipDO> pageResult = new PageResult<>();
pageResult.setList(invoicesDOS);
long size =(long) invoicesDOS.size();
pageResult.setTotal(size);
return pageResult;
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.archives.dal.mysql.bankslip.BankSlipMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save