| | |
| | | custom: |
| | | rabbitmq: |
| | | # 集群地址,用逗号分隔 |
| | | host: 61.143.42.70 |
| | | port: 7008 |
| | | virtual-host: GF_HOST_TEST |
| | | username: user_test |
| | | password: testuser_& |
| | | host: 172.16.24.14 |
| | | port: 5672 |
| | | virtual-host: GF_HOST |
| | | username: admin |
| | | password: |
| | | serialNumber: |
| | | cache: |
| | | enabled: true |
| | |
| | | #数据库 相关配置 |
| | | datasource: |
| | | master: #主数据库 |
| | | ip: 61.143.42.70 # IP |
| | | port: 7006 #端口 |
| | | ip: 172.16.24.11 # IP |
| | | port: 3306 #端口 |
| | | database: hc_cwxt #数据库名 |
| | | username: #用户名 |
| | | username: root #用户名 |
| | | password: #密码 |
| | | slave: #从数据库 |
| | | enabled: false #是否开启从数据库 关闭时以下信息可以不用配置 |
| | |
| | | log-slow-sql: true # 慢SQL记录 |
| | | #redis 相关配置 |
| | | redis: |
| | | host: localhost #访问地址 |
| | | host: 172.16.24.13 #访问地址 |
| | | port: 6379 #端口 |
| | | password: #密码 |
| | | timeout: 10s #超时时间 |
| | |
| | | clerk: "钟文洋" |
| | | salerAddress: "珠海市香洲区南屏镇通港一路120号" |
| | | invoicingAddress: "http://localhost:6012/api/third/jyjy/common/invoicing" |
| | | returnAddress: "http://172.16.24.19:6720/api/third/invoice" |
| | | returnAddress: "http://172.16.24.19:6014/api/third/invoice" |
| | | tms: |
| | | url: "http://61.143.42.70:7000/tms-api/" |
| | |
| | | clerk: "钟文洋" |
| | | salerAddress: "珠海市香洲区南屏镇通港一路120号" |
| | | invoicingAddress: "http://localhost:6219/api/third/jyjy/common/invoicing" |
| | | returnAddress: "http://127.0.0.1:6620/api/third/invoice" |
| | | returnAddress: "http://127.0.0.1:6620/api/third/invoice" |
| | | tms: |
| | | url: "http://61.143.42.70:7010/cwgttest-api/" |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.cwgl.domain.PayableBillManagement; |
| | | import com.ruoyi.cwgl.domain.PayableFeeDetail; |
| | | import com.ruoyi.cwgl.domain.PayableFeeManagement; |
| | | import com.ruoyi.cwgl.domain.ReceivableBillManagement; |
| | | import com.ruoyi.cwgl.domain.ReceivableFeeDetail; |
| | | import com.ruoyi.cwgl.domain.ReceivableFeeManagement; |
| | | import com.ruoyi.cwgl.domain.*; |
| | | import com.ruoyi.cwgl.domain.dto.BillAuditDto; |
| | | import com.ruoyi.cwgl.domain.dto.PayableBillApiDto; |
| | | import com.ruoyi.cwgl.domain.dto.ReceivableBillApiDto; |
| | | import com.ruoyi.cwgl.service.IPayableBillManagementService; |
| | |
| | | billManagement.setSettlementCategory(billDto.getSettlementCategory()); |
| | | billManagement.setSettlementPeriod(billDto.getSettlementPeriod()); |
| | | billManagement.setStatus(billDto.getStatus() != null ? billDto.getStatus() : "draft"); |
| | | billManagement.setAuditStatus(billDto.getAuditStatus() != null ? billDto.getAuditStatus() : 0); |
| | | billManagement.setRemark(billDto.getRemark()); |
| | | billManagement.setCreateTime(DateUtils.getNowDate()); |
| | | billManagement.setCreateBy("api_system"); |
| | |
| | | |
| | | // 设置其他信息 |
| | | billManagement.setStatus(billDto.getStatus() != null ? billDto.getStatus() : "draft"); |
| | | billManagement.setAuditStatus(billDto.getAuditStatus() != null ? billDto.getAuditStatus() : 0); |
| | | billManagement.setRemark(billDto.getRemark()); |
| | | billManagement.setCreateTime(DateUtils.getNowDate()); |
| | | billManagement.setCreateBy("api_system"); |
| | |
| | | import com.ruoyi.cwgl.domain.InvoiceManage; |
| | | import com.ruoyi.cwgl.domain.PayableBillManagement; |
| | | import com.ruoyi.cwgl.domain.PayableInvoiceBusiness; |
| | | import com.ruoyi.cwgl.domain.dto.BillAuditDto; |
| | | import com.ruoyi.cwgl.domain.dto.PayableAuditLog; |
| | | import com.ruoyi.cwgl.service.IInvoiceManageService; |
| | | import com.ruoyi.cwgl.service.IPayableBillManagementService; |
| | | import com.ruoyi.cwgl.service.IPayableInvoiceBusinessService; |
| | | import com.ruoyi.cwgl.service.ITmsAuditLogPushService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IPayableInvoiceBusinessService payableInvoiceBusinessService; |
| | | |
| | | @Autowired |
| | | private ITmsAuditLogPushService tmsAuditLogPushService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | return AjaxResult.success(invoicedAmount); |
| | | } |
| | | |
| | | /** |
| | | * 应付账单审核接口 |
| | | * @param billAuditDto 审核数据传输对象 |
| | | * @return 审核结果 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:payableBillManagement:audit')") |
| | | @Log(title = "应付账单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/audit") |
| | | public AjaxResult auditPayableBill(@RequestBody BillAuditDto billAuditDto) { |
| | | try { |
| | | // 1. 查询应付账单 |
| | | PayableBillManagement bill = payableBillManagementService.selectPayableBillManagementById(billAuditDto.getBillId()); |
| | | if (bill == null) { |
| | | return AjaxResult.error("应付账单不存在,ID:" + billAuditDto.getBillId()); |
| | | } |
| | | |
| | | // 2. 记录审核前状态 |
| | | Integer beforeAuditStatus = bill.getAuditStatus(); |
| | | |
| | | // 3. 更新审核状态 |
| | | bill.setAuditStatus(billAuditDto.getAuditResult()); |
| | | bill.setUpdateTime(new java.util.Date()); |
| | | bill.setUpdateBy(getUsername()); |
| | | |
| | | // 4. 更新账单 |
| | | int rows = payableBillManagementService.updatePayableBillManagement(bill); |
| | | if (rows <= 0) { |
| | | return AjaxResult.error("更新应付账单审核状态失败"); |
| | | } |
| | | |
| | | // 5. 记录审核日志 |
| | | savePayableAuditLog(billAuditDto, bill, beforeAuditStatus); |
| | | |
| | | // 6. 如果来源系统是TMS,推送审核日志到TMS |
| | | if (tmsAuditLogPushService.isPayableBillFromTms(bill.getSystemNo())) { |
| | | try { |
| | | PayableAuditLog auditLog = createPayableAuditLog(billAuditDto, bill, beforeAuditStatus); |
| | | tmsAuditLogPushService.pushPayableAuditLog(auditLog); |
| | | } catch (Exception e) { |
| | | logger.error("推送应付账单审核日志到TMS失败,账单ID:{}", bill.getId(), e); |
| | | // 推送失败不影响主流程,只记录日志 |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("应付账单审核成功"); |
| | | |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("应付账单审核失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存应付账单审核日志 |
| | | */ |
| | | private void savePayableAuditLog(BillAuditDto billAuditDto, PayableBillManagement bill, Integer beforeAuditStatus) { |
| | | // 这里需要实现日志记录逻辑 |
| | | // 可以使用原有的日志服务或系统日志 |
| | | logger.info("应付账单审核日志 - 账单ID:{},账单编号:{},审核前状态:{},审核结果:{},审核意见:{}", |
| | | bill.getId(), bill.getSystemNo(), |
| | | getAuditStatusText(beforeAuditStatus), |
| | | getAuditResultText(billAuditDto.getAuditResult()), |
| | | billAuditDto.getAuditComment() != null ? billAuditDto.getAuditComment() : "无"); |
| | | } |
| | | |
| | | /** |
| | | * 获取审核状态文本 |
| | | */ |
| | | private String getAuditStatusText(Integer auditStatus) { |
| | | switch (auditStatus) { |
| | | case 0: return "待审核"; |
| | | case 1: return "审核通过"; |
| | | case 2: return "审核驳回"; |
| | | default: return "未知状态"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取审核结果文本 |
| | | */ |
| | | private String getAuditResultText(Integer auditResult) { |
| | | switch (auditResult) { |
| | | case 1: return "通过"; |
| | | case 2: return "驳回"; |
| | | default: return "未知结果"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建应付账单审核日志对象 |
| | | */ |
| | | private PayableAuditLog createPayableAuditLog(BillAuditDto billAuditDto, PayableBillManagement bill, Integer beforeAuditStatus) { |
| | | PayableAuditLog auditLog = new PayableAuditLog(); |
| | | auditLog.setBillId(bill.getId()); |
| | | auditLog.setBillNo(bill.getSystemNo()); |
| | | auditLog.setBillName(bill.getBillName()); |
| | | auditLog.setSupplierName(bill.getSupplierName()); |
| | | auditLog.setSourceSystem(tmsAuditLogPushService.getPayableBillSourceSystem(bill.getSystemNo())); |
| | | auditLog.setBeforeAuditStatus(beforeAuditStatus); |
| | | auditLog.setAuditResult(billAuditDto.getAuditResult()); |
| | | auditLog.setAuditComment(billAuditDto.getAuditComment()); |
| | | auditLog.setAuditUser(getUsername()); |
| | | auditLog.setAuditTime(new java.util.Date()); |
| | | auditLog.setTotalAmount(bill.getTotalAmount()); |
| | | return auditLog; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.cwgl.domain.InvoiceManage; |
| | | import com.ruoyi.cwgl.domain.ReceivableBillManagement; |
| | | import com.ruoyi.cwgl.domain.ReceivableInvoiceBusiness; |
| | | import com.ruoyi.cwgl.domain.dto.BillAuditDto; |
| | | import com.ruoyi.cwgl.domain.dto.ReceivableAuditLog; |
| | | import com.ruoyi.cwgl.service.IInvoiceManageService; |
| | | import com.ruoyi.cwgl.service.IReceivableBillManagementService; |
| | | import com.ruoyi.cwgl.service.IReceivableInvoiceBusinessService; |
| | | import com.ruoyi.cwgl.service.ITmsAuditLogPushService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IReceivableInvoiceBusinessService receivableInvoiceBusinessService; |
| | | |
| | | @Autowired |
| | | private ITmsAuditLogPushService tmsAuditLogPushService; |
| | | |
| | | |
| | | |
| | |
| | | receivableBillManagementService.accountAnalysisExport(receivableBillManagement,exportKey); |
| | | return AjaxResult.success("导出请求成功,请稍后点击下载...!"); |
| | | } |
| | | |
| | | /** |
| | | * 应收账单审核接口 |
| | | * @param billAuditDto 审核数据传输对象 |
| | | * @return 审核结果 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:audit')") |
| | | @Log(title = "应收账单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/audit") |
| | | public AjaxResult auditReceivableBill(@RequestBody BillAuditDto billAuditDto) { |
| | | try { |
| | | // 1. 查询应收账单 |
| | | ReceivableBillManagement bill = receivableBillManagementService.selectReceivableBillManagementById(billAuditDto.getBillId()); |
| | | if (bill == null) { |
| | | return AjaxResult.error("应收账单不存在,ID:" + billAuditDto.getBillId()); |
| | | } |
| | | |
| | | // 2. 记录审核前状态 |
| | | Integer beforeAuditStatus = bill.getAuditStatus(); |
| | | |
| | | // 3. 更新审核状态 |
| | | bill.setAuditStatus(billAuditDto.getAuditResult()); |
| | | bill.setUpdateTime(new java.util.Date()); |
| | | bill.setUpdateBy(getUsername()); |
| | | |
| | | // 4. 更新账单 |
| | | int rows = receivableBillManagementService.updateReceivableBillManagement(bill); |
| | | if (rows <= 0) { |
| | | return AjaxResult.error("更新应收账单审核状态失败"); |
| | | } |
| | | |
| | | // 5. 记录审核日志 |
| | | saveReceivableAuditLog(billAuditDto, bill, beforeAuditStatus); |
| | | |
| | | // 6. 如果来源系统是TMS,推送审核日志到TMS |
| | | if (tmsAuditLogPushService.isReceivableBillFromTms(bill.getSystemNo())) { |
| | | try { |
| | | ReceivableAuditLog auditLog = createReceivableAuditLog(billAuditDto, bill, beforeAuditStatus); |
| | | tmsAuditLogPushService.pushReceivableAuditLog(auditLog); |
| | | } catch (Exception e) { |
| | | logger.error("推送应收账单审核日志到TMS失败,账单ID:{}", bill.getId(), e); |
| | | // 推送失败不影响主流程,只记录日志 |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("应收账单审核成功"); |
| | | |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("应收账单审核失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存应收账单审核日志 |
| | | */ |
| | | private void saveReceivableAuditLog(BillAuditDto billAuditDto, ReceivableBillManagement bill, Integer beforeAuditStatus) { |
| | | // 这里需要实现日志记录逻辑 |
| | | // 可以使用原有的日志服务或系统日志 |
| | | logger.info("应收账单审核日志 - 账单ID:{},账单编号:{},审核前状态:{},审核结果:{},审核意见:{}", |
| | | bill.getId(), bill.getSystemNo(), |
| | | getAuditStatusText(beforeAuditStatus), |
| | | getAuditResultText(billAuditDto.getAuditResult()), |
| | | billAuditDto.getAuditComment() != null ? billAuditDto.getAuditComment() : "无"); |
| | | } |
| | | |
| | | /** |
| | | * 获取审核状态文本 |
| | | */ |
| | | private String getAuditStatusText(Integer auditStatus) { |
| | | switch (auditStatus) { |
| | | case 0: return "待审核"; |
| | | case 1: return "审核通过"; |
| | | case 2: return "审核驳回"; |
| | | default: return "未知状态"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取审核结果文本 |
| | | */ |
| | | private String getAuditResultText(Integer auditResult) { |
| | | switch (auditResult) { |
| | | case 1: return "通过"; |
| | | case 2: return "驳回"; |
| | | default: return "未知结果"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建应收账单审核日志对象 |
| | | */ |
| | | private ReceivableAuditLog createReceivableAuditLog(BillAuditDto billAuditDto, ReceivableBillManagement bill, Integer beforeAuditStatus) { |
| | | ReceivableAuditLog auditLog = new ReceivableAuditLog(); |
| | | auditLog.setBillId(bill.getId()); |
| | | auditLog.setBillNo(bill.getSystemNo()); |
| | | auditLog.setBillName(bill.getBillName()); |
| | | auditLog.setCustomerName(bill.getCustomerName()); |
| | | auditLog.setSourceSystem(tmsAuditLogPushService.getReceivableBillSourceSystem(bill.getSystemNo())); |
| | | auditLog.setBeforeAuditStatus(beforeAuditStatus); |
| | | auditLog.setAuditResult(billAuditDto.getAuditResult()); |
| | | auditLog.setAuditComment(billAuditDto.getAuditComment()); |
| | | auditLog.setAuditUser(getUsername()); |
| | | auditLog.setAuditTime(new java.util.Date()); |
| | | auditLog.setTotalAmount(bill.getTotalAmount()); |
| | | return auditLog; |
| | | } |
| | | |
| | | } |
| | |
| | | private String status; |
| | | |
| | | |
| | | /** 审核状态(0:未审核;1:审核通过;2:审核不通过) */ |
| | | @Excel(name = "审核状态") |
| | | |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | |
| | | /** 备注 */ |
| | | @Excel(name = "备注") |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 状态(draft:草稿;generated:已生成;sent:已发送;partial_paid:部分收款;paid:已收款;cancelled:已取消) |
| | | * 状态(draft:草稿;generated:已生成;sent:已发送;pending_review:待审核;partial_paid:部分收款;paid:已收款;cancelled:已取消) |
| | | */ |
| | | @Excel(name = "状态") |
| | | |
| | |
| | | private String status; |
| | | |
| | | |
| | | /** 审核状态(0:未审核;1:审核通过;2:审核不通过) */ |
| | | @Excel(name = "审核状态") |
| | | |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | |
| | | /** 备注 */ |
| | | @Excel(name = "备注") |
| | | |
| New file |
| | |
| | | package com.ruoyi.cwgl.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 账单审核数据传输对象 |
| | | */ |
| | | @Data |
| | | public class BillAuditDto { |
| | | |
| | | /** |
| | | * 账单ID |
| | | */ |
| | | @NotNull(message = "账单ID不能为空") |
| | | private Integer billId; |
| | | |
| | | /** |
| | | * 账单类型 (0:应收, 1:应付) |
| | | */ |
| | | @NotBlank(message = "账单类型不能为空") |
| | | private Integer billType; |
| | | |
| | | /** |
| | | * 审核结果 (1:通过, 2:驳回) |
| | | */ |
| | | @NotNull(message = "审核结果不能为空") |
| | | private Integer auditResult; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | private String auditComment; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 应付账单审核日志数据传输对象 |
| | | */ |
| | | @Data |
| | | public class PayableAuditLog { |
| | | |
| | | /** |
| | | * 账单ID |
| | | */ |
| | | private Integer billId; |
| | | |
| | | /** |
| | | * 账单编号 |
| | | */ |
| | | private String billNo; |
| | | |
| | | /** |
| | | * 账单名称 |
| | | */ |
| | | private String billName; |
| | | |
| | | /** |
| | | * 供应商名称 |
| | | */ |
| | | private String supplierName; |
| | | |
| | | /** |
| | | * 来源系统 |
| | | */ |
| | | private String sourceSystem; |
| | | |
| | | /** |
| | | * 审核前状态 |
| | | */ |
| | | private Integer beforeAuditStatus; |
| | | |
| | | /** |
| | | * 审核结果 |
| | | */ |
| | | private Integer auditResult; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | private String auditComment; |
| | | |
| | | /** |
| | | * 审核人 |
| | | */ |
| | | private String auditUser; |
| | | |
| | | /** |
| | | * 审核时间 |
| | | */ |
| | | private Date auditTime; |
| | | |
| | | /** |
| | | * 总金额 |
| | | */ |
| | | private java.math.BigDecimal totalAmount; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date billDueDate; |
| | | |
| | | /** 状态(draft:草稿;generated:已生成;sent:已发送;partial_paid:部分付款;paid:已付款;cancelled:已取消) */ |
| | | /** 状态(draft:草稿;generated:已生成;sent:已发送;pending_review:待审核;partial_paid:部分付款;paid:已付款;cancelled:已取消) */ |
| | | private String status; |
| | | |
| | | /** 审核状态(0:未审核;1:审核通过;2:审核不通过) */ |
| | | private Integer auditStatus; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 应收账单审核日志数据传输对象 |
| | | */ |
| | | @Data |
| | | public class ReceivableAuditLog { |
| | | |
| | | /** |
| | | * 账单ID |
| | | */ |
| | | private Integer billId; |
| | | |
| | | /** |
| | | * 账单编号 |
| | | */ |
| | | private String billNo; |
| | | |
| | | /** |
| | | * 账单名称 |
| | | */ |
| | | private String billName; |
| | | |
| | | /** |
| | | * 客户名称 |
| | | */ |
| | | private String customerName; |
| | | |
| | | /** |
| | | * 来源系统 |
| | | */ |
| | | private String sourceSystem; |
| | | |
| | | /** |
| | | * 审核前状态 |
| | | */ |
| | | private Integer beforeAuditStatus; |
| | | |
| | | /** |
| | | * 审核结果 |
| | | */ |
| | | private Integer auditResult; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | private String auditComment; |
| | | |
| | | /** |
| | | * 审核人 |
| | | */ |
| | | private String auditUser; |
| | | |
| | | /** |
| | | * 审核时间 |
| | | */ |
| | | private Date auditTime; |
| | | |
| | | /** |
| | | * 总金额 |
| | | */ |
| | | private java.math.BigDecimal totalAmount; |
| | | } |
| | |
| | | /** 结算期 */ |
| | | private String settlementPeriod; |
| | | |
| | | /** 状态(draft:草稿;generated:已生成;sent:已发送;partial_paid:部分收款;paid:已收款;cancelled:已取消) */ |
| | | /** 状态(draft:草稿;generated:已生成;sent:已发送;pending_review:待审核;partial_paid:部分收款;paid:已收款;cancelled:已取消) */ |
| | | private String status; |
| | | |
| | | /** 审核状态(0:未审核;1:审核通过;2:审核不通过) */ |
| | | private Integer auditStatus; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.service; |
| | | |
| | | import com.ruoyi.cwgl.domain.dto.PayableAuditLog; |
| | | import com.ruoyi.cwgl.domain.dto.ReceivableAuditLog; |
| | | |
| | | /** |
| | | * TMS审核日志推送服务接口 |
| | | */ |
| | | public interface ITmsAuditLogPushService { |
| | | |
| | | /** |
| | | * 推送应付账单审核日志到TMS |
| | | * @param auditLog 应付账单审核日志 |
| | | * @return 推送是否成功 |
| | | */ |
| | | boolean pushPayableAuditLog(PayableAuditLog auditLog); |
| | | |
| | | /** |
| | | * 推送应收账单审核日志到TMS |
| | | * @param auditLog 应收账单审核日志 |
| | | * @return 推送是否成功 |
| | | */ |
| | | boolean pushReceivableAuditLog(ReceivableAuditLog auditLog); |
| | | |
| | | /** |
| | | * 判断应付账单是否来自TMS系统 |
| | | * @param billNo 账单编号 |
| | | * @return 是否来自TMS系统 |
| | | */ |
| | | boolean isPayableBillFromTms(String billNo); |
| | | |
| | | /** |
| | | * 判断应收账单是否来自TMS系统 |
| | | * @param billNo 账单编号 |
| | | * @return 是否来自TMS系统 |
| | | */ |
| | | boolean isReceivableBillFromTms(String billNo); |
| | | |
| | | /** |
| | | * 获取应付账单的来源系统 |
| | | * @param billNo 账单编号 |
| | | * @return 来源系统 |
| | | */ |
| | | String getPayableBillSourceSystem(String billNo); |
| | | |
| | | /** |
| | | * 获取应收账单的来源系统 |
| | | * @param billNo 账单编号 |
| | | * @return 来源系统 |
| | | */ |
| | | String getReceivableBillSourceSystem(String billNo); |
| | | } |
| New file |
| | |
| | | package com.ruoyi.cwgl.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.cwgl.domain.PayableFeeManagement; |
| | | import com.ruoyi.cwgl.domain.ReceivableFeeManagement; |
| | | import com.ruoyi.cwgl.domain.dto.PayableAuditLog; |
| | | import com.ruoyi.cwgl.domain.dto.ReceivableAuditLog; |
| | | import com.ruoyi.cwgl.service.IPayableFeeManagementService; |
| | | import com.ruoyi.cwgl.service.IReceivableFeeManagementService; |
| | | import com.ruoyi.cwgl.service.ITmsAuditLogPushService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * TMS审核日志推送服务实现类 |
| | | */ |
| | | @Service |
| | | public class TmsAuditLogPushServiceImpl implements ITmsAuditLogPushService { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(TmsAuditLogPushServiceImpl.class); |
| | | |
| | | @Value("${custom.tms.url}") |
| | | private String tmsBaseUrl; |
| | | |
| | | @Autowired |
| | | private IPayableFeeManagementService payableFeeManagementService; |
| | | |
| | | @Autowired |
| | | private IReceivableFeeManagementService receivableFeeManagementService; |
| | | |
| | | @Override |
| | | public boolean pushPayableAuditLog(PayableAuditLog auditLog) { |
| | | try { |
| | | String url = tmsBaseUrl + "/api/third/audit/ap-bill"; |
| | | String jsonBody = JSON.toJSONString(auditLog); |
| | | |
| | | log.info("推送应付账单审核日志到TMS: {}", jsonBody); |
| | | |
| | | String response = HttpUtils.sendPost(url, jsonBody); |
| | | log.info("TMS应付账单审核日志推送响应: {}", response); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("推送应付账单审核日志到TMS失败", e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean pushReceivableAuditLog(ReceivableAuditLog auditLog) { |
| | | try { |
| | | String url = tmsBaseUrl + "/api/third/audit/ar-bill"; |
| | | String jsonBody = JSON.toJSONString(auditLog); |
| | | |
| | | log.info("推送应收账单审核日志到TMS: {}", jsonBody); |
| | | |
| | | String response = HttpUtils.sendPost(url, jsonBody); |
| | | log.info("TMS应收账单审核日志推送响应: {}", response); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("推送应收账单审核日志到TMS失败", e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断应付账单是否来自TMS系统 |
| | | * @param billNo 账单编号 |
| | | * @return 是否来自TMS系统 |
| | | */ |
| | | public boolean isPayableBillFromTms(String billNo) { |
| | | try { |
| | | PayableFeeManagement query = new PayableFeeManagement(); |
| | | query.setRelatedBillNo(billNo); |
| | | List<PayableFeeManagement> fees = payableFeeManagementService.selectPayableFeeManagementList(query); |
| | | |
| | | if (fees != null && !fees.isEmpty()) { |
| | | // 检查是否有费用来自TMS系统 |
| | | return fees.stream() |
| | | .anyMatch(fee -> "TMS".equalsIgnoreCase(fee.getSourceSystem())); |
| | | } |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("判断应付账单来源系统失败", e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断应收账单是否来自TMS系统 |
| | | * @param billNo 账单编号 |
| | | * @return 是否来自TMS系统 |
| | | */ |
| | | public boolean isReceivableBillFromTms(String billNo) { |
| | | try { |
| | | ReceivableFeeManagement query = new ReceivableFeeManagement(); |
| | | query.setRelatedBillNo(billNo); |
| | | List<ReceivableFeeManagement> fees = receivableFeeManagementService.selectReceivableFeeManagementList(query); |
| | | |
| | | if (fees != null && !fees.isEmpty()) { |
| | | // 检查是否有费用来自TMS系统 |
| | | return fees.stream() |
| | | .anyMatch(fee -> "tms".equalsIgnoreCase(fee.getSourceSystem())); |
| | | } |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("判断应收账单来源系统失败", e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取应付账单的来源系统 |
| | | * @param billNo 账单编号 |
| | | * @return 来源系统,如果多个来源系统则返回第一个TMS系统,否则返回第一个非空系统 |
| | | */ |
| | | public String getPayableBillSourceSystem(String billNo) { |
| | | try { |
| | | PayableFeeManagement query = new PayableFeeManagement(); |
| | | query.setRelatedBillNo(billNo); |
| | | List<PayableFeeManagement> fees = payableFeeManagementService.selectPayableFeeManagementList(query); |
| | | |
| | | if (fees != null && !fees.isEmpty()) { |
| | | // 优先返回TMS系统 |
| | | return fees.stream() |
| | | .map(PayableFeeManagement::getSourceSystem) |
| | | .filter(source -> source != null && !source.trim().isEmpty()) |
| | | .findFirst() |
| | | .orElse(null); |
| | | } |
| | | return null; |
| | | } catch (Exception e) { |
| | | log.error("获取应付账单来源系统失败", e); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取应收账单的来源系统 |
| | | * @param billNo 账单编号 |
| | | * @return 来源系统,如果多个来源系统则返回第一个TMS系统,否则返回第一个非空系统 |
| | | */ |
| | | public String getReceivableBillSourceSystem(String billNo) { |
| | | try { |
| | | ReceivableFeeManagement query = new ReceivableFeeManagement(); |
| | | query.setRelatedBillNo(billNo); |
| | | List<ReceivableFeeManagement> fees = receivableFeeManagementService.selectReceivableFeeManagementList(query); |
| | | |
| | | if (fees != null && !fees.isEmpty()) { |
| | | // 优先返回TMS系统 |
| | | return fees.stream() |
| | | .map(ReceivableFeeManagement::getSourceSystem) |
| | | .filter(source -> source != null && !source.trim().isEmpty()) |
| | | .findFirst() |
| | | .orElse(null); |
| | | } |
| | | return null; |
| | | } catch (Exception e) { |
| | | log.error("获取应收账单来源系统失败", e); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | <result property="billSendDate" column="bill_send_date" /> |
| | | <result property="billDueDate" column="bill_due_date" /> |
| | | <result property="status" column="status" /> |
| | | <result property="auditStatus" column="audit_status" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectPayableBillManagementVo"> |
| | | select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.supplier_name, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.paid_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_bill_management AS thisTab |
| | | select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.supplier_name, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.paid_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.status, thisTab.audit_status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_bill_management AS thisTab |
| | | </sql> |
| | | <sql id="selectPayableBillManagementVoCount"> |
| | | select count(0) from payable_bill_management as thisTab |
| | |
| | | <if test="billSendDate != null">bill_send_date,</if> |
| | | <if test="billDueDate != null">bill_due_date,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="auditStatus != null">audit_status,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="billSendDate != null">#{billSendDate},</if> |
| | | <if test="billDueDate != null">#{billDueDate},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="auditStatus != null">#{auditStatus},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | <insert id="insertPayableBillManagementBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into payable_bill_management |
| | | <trim prefix="(" suffix=") values" suffixOverrides=","> |
| | | id,system_no,bill_name,supplier_name,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,paid_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,status,remark,create_by,create_time,update_by,update_time,deleted, |
| | | id,system_no,bill_name,supplier_name,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,paid_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,status,audit_status,remark,create_by,create_time,update_by,update_time,deleted, |
| | | </trim> |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | <trim prefix="(" suffix=") " suffixOverrides=","> |
| | | #{item.id},#{item.systemNo},#{item.billName},#{item.supplierName},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.paidAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted}, |
| | | #{item.id},#{item.systemNo},#{item.billName},#{item.supplierName},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.paidAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.status},#{item.auditStatus},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted}, |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | |
| | | <if test="billSendDate != null">bill_send_date = #{billSendDate},</if> |
| | | <if test="billDueDate != null">bill_due_date = #{billDueDate},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="auditStatus != null">audit_status = #{auditStatus},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | <result property="accountRemark" column="account_remark" /> |
| | | <result property="overdueInterest" column="overdue_interest" /> |
| | | <result property="status" column="status" /> |
| | | <result property="auditStatus" column="audit_status" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectReceivableBillManagementVo"> |
| | | select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_name, thisTab.payee, thisTab.responsible_person, thisTab.responsible_leader, thisTab.settlement_method, thisTab.business_type, thisTab.promotion_requirement, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.received_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.due_in_30_days, thisTab.overdue_amount, thisTab.overdue_1_to_30_days, thisTab.overdue_31_to_60_days, thisTab.overdue_61_to_90_days, thisTab.overdue_91_to_180_days, thisTab.overdue_181_to_365_days, thisTab.overdue_over_1_year, thisTab.overdue_days, thisTab.settlement_category, thisTab.settlement_period, thisTab.nc_settlement_date, thisTab.nc_settlement_amount, thisTab.account_remark, thisTab.overdue_interest, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_bill_management AS thisTab |
| | | select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_name, thisTab.payee, thisTab.responsible_person, thisTab.responsible_leader, thisTab.settlement_method, thisTab.business_type, thisTab.promotion_requirement, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.received_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.due_in_30_days, thisTab.overdue_amount, thisTab.overdue_1_to_30_days, thisTab.overdue_31_to_60_days, thisTab.overdue_61_to_90_days, thisTab.overdue_91_to_180_days, thisTab.overdue_181_to_365_days, thisTab.overdue_over_1_year, thisTab.overdue_days, thisTab.settlement_category, thisTab.settlement_period, thisTab.nc_settlement_date, thisTab.nc_settlement_amount, thisTab.account_remark, thisTab.overdue_interest, thisTab.status, thisTab.audit_status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from receivable_bill_management AS thisTab |
| | | </sql> |
| | | <sql id="selectReceivableBillManagementVoCount"> |
| | | select count(0) from receivable_bill_management as thisTab |
| | |
| | | <if test="accountRemark != null and accountRemark != ''">account_remark,</if> |
| | | <if test="overdueInterest != null">overdue_interest,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="auditStatus != null">audit_status,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="accountRemark != null and accountRemark != ''">#{accountRemark},</if> |
| | | <if test="overdueInterest != null">#{overdueInterest},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="auditStatus != null">#{auditStatus},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | <insert id="insertReceivableBillManagementBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into receivable_bill_management |
| | | <trim prefix="(" suffix=") values" suffixOverrides=","> |
| | | system_no,bill_name,customer_name,payee,responsible_person,responsible_leader,settlement_method,business_type,promotion_requirement,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,received_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,settlement_category,settlement_period,nc_settlement_date,nc_settlement_amount,account_remark,overdue_interest,status,remark,create_by,create_time,update_by,update_time,deleted, |
| | | system_no,bill_name,customer_name,payee,responsible_person,responsible_leader,settlement_method,business_type,promotion_requirement,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,received_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,settlement_category,settlement_period,nc_settlement_date,nc_settlement_amount,account_remark,overdue_interest,status,audit_status,remark,create_by,create_time,update_by,update_time,deleted, |
| | | </trim> |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | <trim prefix="(" suffix=") " suffixOverrides=","> |
| | | #{item.systemNo},#{item.billName},#{item.customerName},#{item.payee},#{item.responsiblePerson},#{item.responsibleLeader},#{item.settlementMethod},#{item.businessType},#{item.promotionRequirement},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.receivedAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.settlementCategory},#{item.settlementPeriod},#{item.ncSettlementDate},#{item.ncSettlementAmount},#{item.accountRemark},#{item.overdueInterest},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted}, |
| | | #{item.systemNo},#{item.billName},#{item.customerName},#{item.payee},#{item.responsiblePerson},#{item.responsibleLeader},#{item.settlementMethod},#{item.businessType},#{item.promotionRequirement},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.receivedAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.settlementCategory},#{item.settlementPeriod},#{item.ncSettlementDate},#{item.ncSettlementAmount},#{item.accountRemark},#{item.overdueInterest},#{item.status},#{item.auditStatus},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted}, |
| | | </trim> |
| | | </foreach> |
| | | </insert> |
| | |
| | | <if test="accountRemark != null and accountRemark != ''">account_remark = #{accountRemark},</if> |
| | | <if test="overdueInterest != null">overdue_interest = #{overdueInterest},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="auditStatus != null">audit_status = #{auditStatus},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | <if test="item.accountRemark != null and item.accountRemark != ''">account_remark = #{item.accountRemark},</if> |
| | | <if test="item.overdueInterest != null">overdue_interest = #{item.overdueInterest},</if> |
| | | <if test="item.status != null">status = #{item.status},</if> |
| | | <if test="item.auditStatus != null">audit_status = #{item.auditStatus},</if> |
| | | <if test="item.remark != null">remark = #{item.remark},</if> |
| | | <if test="item.createBy != null">create_by = #{item.createBy},</if> |
| | | <if test="item.createTime != null">create_time = #{item.createTime},</if> |
| | |
| | | VITE_APP_ENV = 'production' |
| | | VITE_APP_KEY = 'RUOYI-BASE' |
| | | # 管理系统/生产环境 |
| | | VITE_APP_BASE_API = '/prod-api' |
| | | VITE_APP_BASE_API = '/cwxt-api' |
| | | # 列表操作按钮展示位置 left/right |
| | | VITE_APP_listOptFixed = 'left' |
| | | |
| | | # 上下文 |
| | | VITE_APP_BASE_URL = '/cwxt/' |
| | | # 是否在打包时开启压缩,支持 gzip 和 brotli |
| | | VITE_BUILD_COMPRESS = gzip |