Merge branch 'xizang-changyun' of https://gitee.com/xiaochen991015/xizang
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.system.importExcel.TBankFlowImportExcel; |
| | |
| | | @ApiOperation(value = "获取银行流水列表") |
| | | @PostMapping("/list") |
| | | public R<PageInfo<TBankFlow>> list(@RequestBody TBankFlowQuery query) { |
| | | query.setBusinessDeptId(SecurityUtils.getBusinessDeptId()); |
| | | return R.ok(flowService.pageList(query)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TBillConfirm; |
| | | import com.ruoyi.system.model.TBillDetail; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TBillConfirmService; |
| | | import com.ruoyi.system.service.TBillDetailService; |
| | | import com.ruoyi.system.service.TBillService; |
| | |
| | | @PostMapping("list") |
| | | @ApiOperation("分页查询账单列表") |
| | | public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ |
| | | query.setBusinessDeptId(SecurityUtils.getBusinessDeptId()); |
| | | PageInfo<TBillDto> pageInfo = tBillService.queryPage(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | |
| | | @PostMapping("add") |
| | | @ApiOperation("新增账单") |
| | | public R<PageInfo<TBillDto>> add(@Validated @RequestBody TbillSaveDto bill){ |
| | | bill.setBusinessDeptId(SecurityUtils.getBusinessDeptId()); |
| | | tBillService.saveBill(bill); |
| | | return R.ok(); |
| | | } |
| | |
| | | @ApiOperation("统计") |
| | | @GetMapping("statistics") |
| | | public R<BillStatisticsDto> statistics(){ |
| | | BillStatisticsDto dto = tBillService.statistics(); |
| | | BillStatisticsDto dto = tBillService.statistics(SecurityUtils.getBusinessDeptId()); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.model.TFlowManagement; |
| | | import com.ruoyi.system.query.TFlowManagementQuery; |
| | | import com.ruoyi.system.service.TFlowManagementService; |
| | |
| | | @ApiOperation(value = "获取流水列表") |
| | | @PostMapping("/list") |
| | | public R<PageInfo<TFlowManagement>> list(@RequestBody TFlowManagementQuery query) { |
| | | query.setBusinessDeptId(SecurityUtils.getBusinessDeptId()); |
| | | return R.ok(flowService.pageList(query)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.TencentMailUtil; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.model.TBill; |
| | |
| | | @ApiOperation(value = "获取开票列表") |
| | | @PostMapping("/list") |
| | | public R<PageInfo<TInvoice>> list(@RequestBody TInvoiceQuery query) { |
| | | query.setBusinessDeptId(SecurityUtils.getBusinessDeptId()); |
| | | return R.ok(invoiceService.pageList(query)); |
| | | } |
| | | |
| | |
| | | String fileName = voucherNames[i]; |
| | | Map<String, String> attachment = new HashMap<>(2); // 初始容量为2,避免扩容 |
| | | String tempDir = System.getProperty("java.io.tmpdir"); |
| | | Path filePath = Paths.get(tempDir, fileName); |
| | | Path filePath = Paths.get(tempDir, "invoice"); |
| | | // 保存到临时目录 |
| | | tencentCosUtil.download(voucherUrl,filePath.toString(),fileName); |
| | | |
| | |
| | | messageBodyPart = new MimeBodyPart(); |
| | | String filePath = map.get("filePath"); |
| | | String fileName = map.get("fileName"); |
| | | tempFilePath.add(Paths.get(filePath)); |
| | | tempFilePath.add(Paths.get(filePath,fileName)); |
| | | FileDataSource source = new FileDataSource(filePath+"\\"+fileName); |
| | | messageBodyPart.setDataHandler(new DataHandler(source)); |
| | | // String filenameEncode = MimeUtility.encodeText(fileName, "UTF-8", "base64"); |
| | |
| | | * @since 2025-02-07 |
| | | */ |
| | | public interface TBankFlowMapper extends BaseMapper<TBankFlow> { |
| | | TBankFlowStatisticsVo getPaymentStats(@Param("req") TBankFlowQuery query); |
| | | TBankFlowStatisticsVo getPaymentStats(@Param("req") TBankFlowQuery query,@Param("businessDeptId") String businessDeptId); |
| | | |
| | | } |
| | |
| | | |
| | | TBillDto selectDetailByBillId(@Param("billId") String billId); |
| | | |
| | | BigDecimal statisticsAllRent(); |
| | | BigDecimal statisticsAllRent(@Param("busDeptId") String busDeptId); |
| | | |
| | | BigDecimal statisticsNoPay(); |
| | | BigDecimal statisticsNoPay(@Param("busDeptId") String busDeptId); |
| | | |
| | | BigDecimal statisticsPayed(); |
| | | BigDecimal statisticsPayed(@Param("busDeptId") String busDeptId); |
| | | |
| | | BigDecimal statisticsOverdue(); |
| | | BigDecimal statisticsOverdue(@Param("busDeptId") String busDeptId); |
| | | |
| | | Integer batchBillCount(@Param("userId")String userId, @Param("billIds")List<String> billIds); |
| | | /** |
| | |
| | | * @since 2025-01-17 |
| | | */ |
| | | public interface TFlowManagementMapper extends BaseMapper<TFlowManagement> { |
| | | TFlowManagementStatisticsVo getPaymentStats(@Param("req") TFlowManagementQuery query); |
| | | TFlowManagementStatisticsVo getPaymentStats(@Param("req") TFlowManagementQuery query,@Param("businessDeptId") String businessDeptId); |
| | | |
| | | } |
| | |
| | | @TableId("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | @ApiModelProperty(value = "银行流水号") |
| | | @TableField("bank_serial_number") |
| | | private String bankSerialNumber; |
| | |
| | | @TableField("contract_id") |
| | | private String contractId; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | @ApiModelProperty(value = "合同编号") |
| | | @TableField("contract_number") |
| | | private String contractNumber; |
| | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | @ApiModelProperty(value = "系统流水号") |
| | | @TableField("sys_serial_number") |
| | | private String sysSerialNumber; |
| | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | @ApiModelProperty(value = "申请编号") |
| | | @TableField("invoice_number") |
| | | private String invoiceNumber; |
| | |
| | | @ApiModelProperty(value = "支付结束时间") |
| | | private String payEndTime; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TBillQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | private String businessDeptId; |
| | | /** |
| | | * 缴费状态 1=未缴费 2=待确认 3=已缴费 4=已逾期 |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "支付结束时间") |
| | | private String payEndTime; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | private String businessDeptId; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "开票文件名称") |
| | | private String invoiceVoucherName; |
| | | |
| | | @ApiModelProperty(value = "营运部门ID") |
| | | private String businessDeptId; |
| | | |
| | | } |
| | |
| | | |
| | | Boolean cashPay(CachPayDto offlinePayDto); |
| | | |
| | | BillStatisticsDto statistics(); |
| | | BillStatisticsDto statistics(String busdeptId); |
| | | |
| | | Integer batchBillCount(String userId, List<String> billIds); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.importExcel.TBankFlowImportExcel; |
| | | import com.ruoyi.system.mapper.TBankFlowMapper; |
| | |
| | | .ge(StringUtils.isNotEmpty(query.getPayStartTime()),TBankFlow::getPayTime,query.getPayStartTime()) |
| | | .lt(StringUtils.isNotEmpty(query.getPayEndTime()),TBankFlow::getPayTime,query.getPayEndTime()) |
| | | .eq(null != query.getFlowStatus(),TBankFlow::getFlowStatus,query.getFlowStatus()) |
| | | .eq(StringUtils.isNotEmpty(query.getBusinessDeptId())&& !"0".equals(query.getBusinessDeptId()),TBankFlow::getBusinessDeptId,query.getBusinessDeptId()) |
| | | .orderByDesc(TBankFlow::getCreateTime); |
| | | return this.baseMapper.selectPage(pageInfo, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public TBankFlowStatisticsVo getPaymentStats(TBankFlowQuery query) { |
| | | return this.baseMapper.getPaymentStats(query); |
| | | return this.baseMapper.getPaymentStats(query,SecurityUtils.getBusinessDeptId()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TBankFlow> searchByBankSerialNumber(String bankSerialNumber) { |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | |
| | | LambdaQueryWrapper<TBankFlow> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.like(StringUtils.isNotEmpty(bankSerialNumber),TBankFlow::getBankSerialNumber,bankSerialNumber) |
| | | .eq(StringUtils.isNotEmpty(bankSerialNumber) && !"0".equals(bankSerialNumber),TBankFlow::getBusinessDeptId,businessDeptId) |
| | | .orderByDesc(TBankFlow::getPayTime); |
| | | |
| | | PageInfo<TBankFlow> pageInfo = new PageInfo<>(1, 20); |
| | | pageInfo = this.baseMapper.selectPage(pageInfo, queryWrapper); |
| | | return pageInfo.getRecords(); |
| | |
| | | |
| | | @Override |
| | | public void saveImportBatch(List<TBankFlowImportExcel> list, List<TBankFlowImportExcel> failList) { |
| | | String businessDeptId = SecurityUtils.getBusinessDeptId(); |
| | | for (TBankFlowImportExcel row : list) { |
| | | try { |
| | | TBankFlow preexist = findUniq(row.getBankSerialNumber()); |
| | |
| | | } |
| | | TBankFlow flow = new TBankFlow(); |
| | | BeanUtils.copyProperties(row,flow); |
| | | flow.setBusinessDeptId(businessDeptId); |
| | | try { |
| | | LocalDateTime parse = LocalDateTime.parse(row.getPayTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | flow.setPayTime(parse); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BillStatisticsDto statistics() { |
| | | public BillStatisticsDto statistics(String busDeptId) { |
| | | BillStatisticsDto dto = new BillStatisticsDto(); |
| | | dto.setRent(getBaseMapper().statisticsAllRent()); |
| | | dto.setNopay(getBaseMapper().statisticsNoPay()); |
| | | dto.setPayed(getBaseMapper().statisticsPayed()); |
| | | dto.setOverdue(getBaseMapper().statisticsOverdue()); |
| | | dto.setRent(getBaseMapper().statisticsAllRent(busDeptId)); |
| | | dto.setNopay(getBaseMapper().statisticsNoPay(busDeptId)); |
| | | dto.setPayed(getBaseMapper().statisticsPayed(busDeptId)); |
| | | dto.setOverdue(getBaseMapper().statisticsOverdue(busDeptId)); |
| | | return dto; |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TFlowManagementMapper; |
| | | import com.ruoyi.system.model.TFlowManagement; |
| | |
| | | .ge(StringUtils.isNotEmpty(query.getPayStartTime()),TFlowManagement::getPayTime,query.getPayStartTime()) |
| | | .lt(StringUtils.isNotEmpty(query.getPayEndTime()),TFlowManagement::getPayTime,query.getPayEndTime()) |
| | | .eq(null != query.getPayType(),TFlowManagement::getPayType,query.getPayType()) |
| | | .eq(StringUtils.isNotEmpty(query.getBusinessDeptId()) && !"0".equals(query.getBusinessDeptId()),TFlowManagement::getBusinessDeptId,query.getBusinessDeptId()) |
| | | .orderByDesc(TFlowManagement::getCreateTime) |
| | | ; |
| | | return this.baseMapper.selectPage(pageInfo,queryWrapper); |
| | |
| | | |
| | | @Override |
| | | public TFlowManagementStatisticsVo getPaymentStats(TFlowManagementQuery query) { |
| | | return this.baseMapper.getPaymentStats(query); |
| | | return this.baseMapper.getPaymentStats(query, SecurityUtils.getBusinessDeptId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .eq(null != query.getStatus(),TInvoice::getStatus,query.getStatus()) |
| | | .ge(StringUtils.isNotEmpty(query.getInvoiceStartTime()),TInvoice::getInvoiceTime,query.getInvoiceStartTime()) |
| | | .le(StringUtils.isNotEmpty(query.getInvoiceEndTime()),TInvoice::getInvoiceTime,query.getInvoiceEndTime()) |
| | | .eq(StringUtils.isNotEmpty(query.getBusinessDeptId())&& ! "0".equals(query.getBusinessDeptId()),TInvoice::getBusinessDeptId,query.getBusinessDeptId()) |
| | | .orderByDesc(TInvoice::getCreateTime); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | |
| | | tInvoice.setInvoiceVoucherName(query.getInvoiceVoucherName()); |
| | | tInvoice.setInvoiceTime(query.getInvoiceTime()); |
| | | tInvoice.setStatus(2); |
| | | |
| | | |
| | | // 异步发送邮件 |
| | | CompletableFuture.runAsync(() -> { |
| | | try { |
| | |
| | | log.error("邮件发送失败", e); |
| | | } |
| | | }); |
| | | |
| | | // 更新数据库 |
| | | return updateById(tInvoice); |
| | | } |
| | |
| | | <if test="req.payEndTime != null and req.payEndTime != ''"> |
| | | and pay_time <= #{req.payEndTime} |
| | | </if> |
| | | <if test='businessDeptId != null and businessDeptId != "" and businessDeptId != "0"'> |
| | | and business_dept_id = #{businessDeptId} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | |
| | | <if test="query.userId != null and query.userId !=''"> |
| | | and t.id = #{query.userId} |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId !=''"> |
| | | and b.business_dept_id = #{businessDeptId} |
| | | </if> |
| | | <if test="query.billType != null"> |
| | | and b.bill_type = #{query.billType} |
| | | </if> |
| | |
| | | |
| | | <select id="statisticsAllRent" resultType="java.math.BigDecimal"> |
| | | SELECT ifnull(sum(payable_fees_money),0) as amount FROM t_bill |
| | | where business_dept_id=#{busDeptId} |
| | | </select> |
| | | |
| | | <select id="statisticsNoPay" resultType="java.math.BigDecimal"> |
| | | SELECT ifnull(sum(outstanding_money),0) as amount FROM t_bill where pay_fees_status!=3 |
| | | AND business_dept_id=#{busDeptId} |
| | | </select> |
| | | |
| | | <select id="statisticsPayed" resultType="java.math.BigDecimal"> |
| | | SELECT ifnull(sum(pay_fees_money),0) as amount FROM t_bill |
| | | where business_dept_id=#{busDeptId} |
| | | </select> |
| | | |
| | | <select id="statisticsOverdue" resultType="java.math.BigDecimal"> |
| | | SELECT ifnull(sum(outstanding_money),0) as amount FROM t_bill where pay_fees_status=4 |
| | | AND business_dept_id=#{busDeptId} |
| | | </select> |
| | | <select id="batchBillCount" resultType="java.lang.Integer"> |
| | | SELECT |
| | |
| | | <if test="req.payEndTime != null and req.payEndTime != ''"> |
| | | and pay_time <= #{req.payEndTime} |
| | | </if> |
| | | <if test='businessDeptId != null and businessDeptId != "" and businessDeptId != "0"'> |
| | | and business_dept_id = #{businessDeptId} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |