银行回单
parent
9cca34a28c
commit
f31904729f
@ -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,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,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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue