|
@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -121,10 +122,7 @@ public class PaymentService extends ServiceImpl<PaymentMapper, Payment> {
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(deleteList)) {
|
|
|
boolean deleteResult = removeByIds(deleteList.stream().map(Payment::getId).collect(Collectors.toList()));
|
|
|
- if (!deleteResult) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return RestResponse.fail(MessageUtils.get("msg.delete.batch.fail"));
|
|
|
- }
|
|
|
+ if (!deleteResult) return RestResponse.fail(MessageUtils.get("msg.delete.batch.fail"));
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(updateList)) {
|
|
|
boolean updateResult = updateBatchById(updateList, updateList.size());
|
|
@@ -140,7 +138,7 @@ public class PaymentService extends ServiceImpl<PaymentMapper, Payment> {
|
|
|
return RestResponse.fail(MessageUtils.get("msg.add.batch.fail"));
|
|
|
}
|
|
|
}
|
|
|
- return RestResponse.fail(MessageUtils.get("msg.modify.success"));
|
|
|
+ return RestResponse.success(MessageUtils.get("msg.modify.success"));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -149,6 +147,7 @@ public class PaymentService extends ServiceImpl<PaymentMapper, Payment> {
|
|
|
* @description 批量修改收款信息
|
|
|
* @date 2019/12/11 3:50 PM
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public RestResponse modifyBatchById(PaymentRequest request) {
|
|
|
List<Payment> paymentList = request.getPaymentList();
|
|
|
List<Long> paymentIdList = paymentList.stream().map(Payment::getId).collect(Collectors.toList());
|