zhangmei
2025-03-27 1fad0578c97abbb7fc30f59eb1de0f23f08ddde1
流水、开票营业部权限
17个文件已修改
60 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBankFlowController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFlowManagementController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInvoiceController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBankFlowMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TFlowManagementMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TBankFlow.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TFlowManagement.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TInvoice.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TBankFlowQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TFlowManagementQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TInvoiceQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBankFlowServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TFlowManagementServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TInvoiceServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TFlowManagementMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBankFlowController.java
@@ -6,6 +6,7 @@
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;
@@ -48,6 +49,7 @@
    @ApiOperation(value = "获取银行流水列表")
    @PostMapping("/list")
    public R<PageInfo<TBankFlow>> list(@RequestBody TBankFlowQuery query) {
        query.setBusinessDeptId(SecurityUtils.getBusinessDeptId());
        return R.ok(flowService.pageList(query));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFlowManagementController.java
@@ -3,6 +3,7 @@
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;
@@ -36,6 +37,7 @@
    @ApiOperation(value = "获取流水列表")
    @PostMapping("/list")
    public R<PageInfo<TFlowManagement>> list(@RequestBody TFlowManagementQuery query) {
        query.setBusinessDeptId(SecurityUtils.getBusinessDeptId());
        return R.ok(flowService.pageList(query));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInvoiceController.java
@@ -5,6 +5,7 @@
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;
@@ -45,6 +46,7 @@
    @ApiOperation(value = "获取开票列表")
    @PostMapping("/list")
    public R<PageInfo<TInvoice>> list(@RequestBody TInvoiceQuery query) {
        query.setBusinessDeptId(SecurityUtils.getBusinessDeptId());
        return R.ok(invoiceService.pageList(query));
    }
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBankFlowMapper.java
@@ -15,6 +15,6 @@
 * @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);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TFlowManagementMapper.java
@@ -15,5 +15,6 @@
 * @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);
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TBankFlow.java
@@ -32,6 +32,10 @@
    @TableId("id")
    private String id;
    @ApiModelProperty(value = "营运部门ID")
    @TableField("business_dept_id")
    private String businessDeptId;
    @ApiModelProperty(value = "银行流水号")
    @TableField("bank_serial_number")
    private String bankSerialNumber;
ruoyi-system/src/main/java/com/ruoyi/system/model/TFlowManagement.java
@@ -35,6 +35,10 @@
    @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;
ruoyi-system/src/main/java/com/ruoyi/system/model/TInvoice.java
@@ -35,6 +35,10 @@
    @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;
ruoyi-system/src/main/java/com/ruoyi/system/query/TBankFlowQuery.java
@@ -57,4 +57,7 @@
    @ApiModelProperty(value = "支付结束时间")
    private String payEndTime;
    @ApiModelProperty(value = "营运部门ID")
    private String businessDeptId;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/TFlowManagementQuery.java
@@ -59,5 +59,8 @@
    @ApiModelProperty(value = "支付结束时间")
    private String payEndTime;
    @ApiModelProperty(value = "营运部门ID")
    private String businessDeptId;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/TInvoiceQuery.java
@@ -58,4 +58,7 @@
    @ApiModelProperty(value = "开票文件名称")
    private String invoiceVoucherName;
    @ApiModelProperty(value = "营运部门ID")
    private String businessDeptId;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBankFlowServiceImpl.java
@@ -3,6 +3,7 @@
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;
@@ -46,13 +47,14 @@
                .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());
    }
    /**
@@ -62,10 +64,12 @@
     */
    @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();
@@ -73,6 +77,7 @@
    @Override
    public void saveImportBatch(List<TBankFlowImportExcel> list, List<TBankFlowImportExcel> failList) {
        String businessDeptId = SecurityUtils.getBusinessDeptId();
        for (TBankFlowImportExcel row : list) {
            try {
                TBankFlow preexist = findUniq(row.getBankSerialNumber());
@@ -83,6 +88,7 @@
                }
                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);
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TFlowManagementServiceImpl.java
@@ -2,6 +2,7 @@
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;
@@ -34,6 +35,7 @@
                .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);
@@ -41,7 +43,7 @@
    @Override
    public TFlowManagementStatisticsVo getPaymentStats(TFlowManagementQuery query) {
        return this.baseMapper.getPaymentStats(query);
        return this.baseMapper.getPaymentStats(query, SecurityUtils.getBusinessDeptId());
    }
    @Override
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TInvoiceServiceImpl.java
@@ -53,6 +53,7 @@
                .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);
    }
@@ -73,8 +74,6 @@
        tInvoice.setInvoiceVoucherName(query.getInvoiceVoucherName());
        tInvoice.setInvoiceTime(query.getInvoiceTime());
        tInvoice.setStatus(2);
        // 异步发送邮件
        CompletableFuture.runAsync(() -> {
            try {
@@ -83,7 +82,6 @@
                log.error("邮件发送失败", e);
            }
        });
        // 更新数据库
        return updateById(tInvoice);
    }
ruoyi-system/src/main/resources/mapper/system/TBankFlowMapper.xml
@@ -58,6 +58,9 @@
            <if test="req.payEndTime != null and req.payEndTime != ''">
                and pay_time &lt;= #{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>
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -163,7 +163,7 @@
    <select id="statisticsNoPay" resultType="java.math.BigDecimal">
        SELECT ifnull(sum(outstanding_money),0) as amount FROM t_bill where pay_fees_status!=3
        where  business_dept_id=#{busDeptId}
        AND  business_dept_id=#{busDeptId}
    </select>
    <select id="statisticsPayed" resultType="java.math.BigDecimal">
@@ -173,7 +173,7 @@
    <select id="statisticsOverdue" resultType="java.math.BigDecimal">
        SELECT ifnull(sum(outstanding_money),0) as amount FROM t_bill where pay_fees_status=4
        where  business_dept_id=#{busDeptId}
        AND  business_dept_id=#{busDeptId}
    </select>
    <select id="batchBillCount" resultType="java.lang.Integer">
        SELECT
ruoyi-system/src/main/resources/mapper/system/TFlowManagementMapper.xml
@@ -64,6 +64,9 @@
            <if test="req.payEndTime != null and req.payEndTime != ''">
                 and pay_time &lt;= #{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>