maven
8 小时以前 1ab612fa454477bfaec03b0fe9133f8881ce29cc
src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java
@@ -26,6 +26,7 @@
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;
@@ -87,7 +88,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,8 +129,13 @@
     */
    @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);
    }