2026-04-23 0005d49a697ce934c6fc2a61ecb75d881b9a76f2
src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java
@@ -26,10 +26,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@@ -52,7 +53,6 @@
    private IProductRecordService productRecordService;
    @Autowired
    private IPaymentRegistrationService paymentRegistrationService;
    /**
@@ -87,7 +87,8 @@
    @ApiOperation("删除付款流水")
    @DeleteMapping("/delPaymentRegistration")
    public AjaxResult delPaymentRegistration(@RequestBody Long id) {
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult delPaymentRegistration(@RequestBody List<Long> id) {
        return toAjax(paymentRegistrationService.delPaymentRegistration(id));
    }
@@ -127,17 +128,22 @@
     */
    @Log(title = "来票登记", businessType = BusinessType.INSERT)
    @PostMapping("/addOrUpdateRegistration")
    public AjaxResult addOrUpdateRegistration(@RequestBody TicketRegistrationDto ticketRegistrationDto) throws IOException {
        return toAjax(ticketRegistrationService.addOrUpdateRegistration(ticketRegistrationDto));
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult addOrUpdateRegistration(@RequestBody List<TicketRegistrationDto> ticketRegistrationDto) throws IOException {
        if(CollectionUtils.isEmpty(ticketRegistrationDto)) return AjaxResult.error("请选择要保存的记录");
        for (TicketRegistrationDto ticketRegistrationDto1 : ticketRegistrationDto) {
            ticketRegistrationService.addOrUpdateRegistration(ticketRegistrationDto1);
        }
        return toAjax(1);
    }
    @GetMapping("/getProductRecordById")
    public AjaxResult getProductRecordById(Long id) {
        if (id == null) {
    @PostMapping("/getProductRecordById")
    public AjaxResult getProductRecordById(@RequestBody ProductRecordDto productRecordDto) {
        if (productRecordDto.getId() == null) {
            return AjaxResult.error("参数错误");
        }
        return AjaxResult.success(productRecordService.getProductRecordById(id));
        return AjaxResult.success(productRecordService.getProductRecordById(productRecordDto));
    }
    @ApiModelProperty("修改来票登记")