package com.ruoyi.api.third.controller;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.tms.domain.PayableAuditLog;
|
import com.ruoyi.tms.domain.ReceivableAuditLog;
|
import com.ruoyi.tms.service.IPayableAuditLogService;
|
import com.ruoyi.tms.service.IReceivableAuditLogService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
/**
|
* 审核日志接收Controller
|
* 用于接收其他系统发送的应付账单和应收账单的审核日志
|
*
|
* @author ruoyi
|
* @date 2026-04-07
|
*/
|
@RestController
|
@RequestMapping("/api/third/audit")
|
@Slf4j
|
public class AuditLogController {
|
|
@Autowired
|
private IPayableAuditLogService payableAuditLogService;
|
|
@Autowired
|
private IReceivableAuditLogService receivableAuditLogService;
|
|
/**
|
* 接收应付账单审核日志
|
*
|
* @param auditLog 应付账单审核日志
|
* @return 结果
|
*/
|
@PostMapping("/ap-bill")
|
public AjaxResult receiveApBillAuditLog(@RequestBody PayableAuditLog auditLog) {
|
try {
|
log.info("接收到应付账单审核日志: {}", auditLog);
|
int result = payableAuditLogService.insertPayableAuditLog(auditLog);
|
if (result > 0) {
|
return AjaxResult.success("接收成功");
|
} else {
|
return AjaxResult.error("接收失败");
|
}
|
} catch (Exception e) {
|
log.error("接收应付账单审核日志失败", e);
|
return AjaxResult.error("接收失败: " + e.getMessage());
|
}
|
}
|
|
/**
|
* 接收应收账单审核日志
|
*
|
* @param auditLog 应收账单审核日志
|
* @return 结果
|
*/
|
@PostMapping("/ar-bill")
|
public AjaxResult receiveArBillAuditLog(@RequestBody ReceivableAuditLog auditLog) {
|
try {
|
log.info("接收到应收账单审核日志: {}", auditLog);
|
int result = receivableAuditLogService.insertReceivableAuditLog(auditLog);
|
if (result > 0) {
|
return AjaxResult.success("接收成功");
|
} else {
|
return AjaxResult.error("接收失败");
|
}
|
} catch (Exception e) {
|
log.error("接收应收账单审核日志失败", e);
|
return AjaxResult.error("接收失败: " + e.getMessage());
|
}
|
}
|
}
|